By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,022 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,022 IT Pros & Developers. It's quick & easy.

Sending Email

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.