Sending Email

M

Mariame

Hi Everyone
im using the following code to send an email:
Dim smtpmail As Mail.SmtpMail

Dim msgRequest As New Mail.MailMessage

msgRequest.BodyFormat = Mail.MailFormat.Text

msgRequest.Subject = "Subject"

msgRequest.To = "to.com"

msgRequest.From = "from.com"

msgRequest.Body = x

smtpmail.SmtpServer = "server"

smtpmail.Send(msgRequest)

the problem is the smtp server is not configure to accept anonymous login so
i have to send username & password to be authenticated .

Any idea about how to do it?
 
J

Jos

Mariame said:
Hi Everyone
im using the following code to send an email:
Dim smtpmail As Mail.SmtpMail

Dim msgRequest As New Mail.MailMessage

msgRequest.BodyFormat = Mail.MailFormat.Text

msgRequest.Subject = "Subject"

msgRequest.To = "to.com"

msgRequest.From = "from.com"

msgRequest.Body = x

smtpmail.SmtpServer = "server"

smtpmail.Send(msgRequest)

the problem is the smtp server is not configure to accept anonymous
login so i have to send username & password to be authenticated .

Any idea about how to do it?

Add these 3 lines:

msgRequest.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthentic
ate", 1)
msgRequest.Add("http://schemas.microsoft.com/cdo/configuration/sendusername"
, "username")
msgRequest.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword"
, "password")

This doesn't work in ASP.NET 1.0, so you'll need at least 1.1 on the server.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top