Sending Email From ASP.NET 1.1

  • Thread starter Thread starter Robert E. Flaherty
  • Start date Start date
Robert,

Add the following to your function or method (define fields like
strSendFromName):


Dim mail As New System.Web.Mail.MailMessage
Dim SmtpMail As System.Web.Mail.SmtpMail

mail.From = "\" & strSendFromName & "\ <" &
strSendFromEmail & ">"
mail.To = "\" & strSendToName & "\ <" & strSendToEmail &
">"

If strCC_ToEmail.Trim <> "" Then
mail.Cc = "\" & strCC_ToName & "\ <" & strCC_ToEmail &
">"
End If

mail.Bcc = "(e-mail address removed)"

mail.Subject = strSubject
mail.Body = strMessage

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"SendEmailUser") 'set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"z&me2ruV") 'set your password here
SmtpMail.SmtpServer = strHost
SmtpMail.Send(mail)

Good luck,

Phin
 
Robert,


Add the following to your function or method (define fields like
strSendFromName and give it a value):


Dim mail As New System.Web.Mail.MailMessage
Dim SmtpMail As System.Web.Mail.SmtpMail


mail.From = "\" & strSendFromName & "\ <" &
strSendFromEmail & ">"
mail.To = "\" & strSendToName & "\ <" & strSendToEmail &
">"


If strCC_ToEmail.Trim <> "" Then
mail.Cc = "\" & strCC_ToName & "\ <" & strCC_ToEmail &
">"
End If


mail.Bcc = "(e-mail address removed)"


mail.Subject = strSubject
mail.Body = strMessage


mail.Fields.Add("http://schemas.microsoft.com/c­do/configuration/smtpauthentic­ate",

"1") 'basic authentication


mail.Fields.Add("http://schemas.microsoft.com/c­do/configuration/sendusername",

"YOUR_EMAILUSER") 'set your username here


mail.Fields.Add("http://schemas.microsoft.com/c­do/configuration/sendpassword",

"YOUR_PASSWORD") 'set your password here
SmtpMail.SmtpServer = strHost
SmtpMail.Send(mail)


Good luck,


Phin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top