469,900 Members | 1,481 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,900 developers. It's quick & easy.

Sending Email

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?


Nov 18 '05 #1
1 1961
Jos
Mariame wrote:
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.

--

Jos
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Paul Lamonby | last post: by
reply views Thread by praba kar | last post: by
3 posts views Thread by Ant | last post: by
2 posts views Thread by =?Utf-8?B?QWRl?= | last post: by
7 posts views Thread by bleachie | last post: by
10 posts views Thread by Markgoldin | last post: by
31 posts views Thread by happyse27 | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.