Personal note from Ace Developer - Corey McClelland
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
About Steve Gray
Steve is a seasoned (translate: old) developer in VB and ASP.NET. He spends most of his time in Dynamics GP, writing custom mods for consulting firms. Crystal reports, eConnect, VS Tools for Dynamics... anything that comes along.