T
techie
I'm trying to use system.web.mail to send an email, but the smtp
server
requires authentication. I came across some info about fields
property
Dim mail As New MailMessage()
mail.To = "(e-mail address removed)
mail.From = "(e-mail address removed)"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenti
cate", "1") 'basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername
", "username") 'set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword
", "password") 'set your password here
SmtpMail.SmtpServer = "smtp.domain.com" 'your real server goes here
SmtpMail.Send(mail)
I get a compilation error:
'Fields' is not a member of 'System.Web.Mail.MailMessage'
Even though I have installed .Net Framework 1.1, i am not able to
compile the code. Can anybody help me on this.
Thanks in advance.
Ash
server
requires authentication. I came across some info about fields
property
Dim mail As New MailMessage()
mail.To = "(e-mail address removed)
mail.From = "(e-mail address removed)"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenti
cate", "1") 'basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername
", "username") 'set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword
", "password") 'set your password here
SmtpMail.SmtpServer = "smtp.domain.com" 'your real server goes here
SmtpMail.Send(mail)
I get a compilation error:
'Fields' is not a member of 'System.Web.Mail.MailMessage'
Even though I have installed .Net Framework 1.1, i am not able to
compile the code. Can anybody help me on this.
Thanks in advance.
Ash