Site Search:
Sign in | Join | Help

This Blog

4Penny offers domain names

Syndication

Tags

No tags have been created or used yet.

Archives

4Penny.net

Corey McClelland

Personal note from Ace Developer - Corey McClelland

Email Authentication in ASP.NET 1.1

To use authenticated smtp mail in ASP.NET 1.1, you need to set the mail.Fields with the server information.  For more information, see the microsoft kb article.

Public Sub sendMail()

  
Dim mail As New System.Web.Mail.MailMessage
  
mail.BodyFormat = System.Web.Mail.MailFormat.Html

   'For more info on authenticated smtp in asp.net 1.1, see
  
'http://support.microsoft.com/kb/555287
  
mail.Fields("http://schemas.microsoft.com/cdo/configuration/smtsperver") = "server"

   mail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
  
mail.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  
mail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  
mail.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user"

  
mail.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pass"

   Try
     
mail.From = "no-reply@4penny.net"
     
mail.To = "corey@4penny.net"
     
mail.Subject = "Test Email"
     
mail.Body = "The ASP.NET 1.1 email test was successful."
     
System.Web.Mail.SmtpMail.SmtpServer = "server"
     
System.Web.Mail.SmtpMail.Send(mail)

   Catch ex As Exception
     
Response.Write(ex.Message)
  
End Try

End Sub

 

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add