How do you log in to an email server using vb.net v1.x

J

JimO

I'm trying to use system.web.mail to send a confirmation registration. I
keep getting an exception. The support at the hosting site says I need to
log into the server first. I'm finding a lot of stuff on sending mail but
nothing on how to login first - unless I want to buy something. It can't be
that difficult can it...? Where should I be looking or what do I need to do
to accomplish this.

thanks,
Jim
 
K

Ken Cox [Microsoft MVP]

Hi Jim,

There's a proposed solution for that here:

http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=622


Dim Msg As New System.Web.Mail.MailMessage
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtpserver"
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")
= 1
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"username"
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"password"
Msg.To = "(e-mail address removed)"
Msg.From = "(e-mail address removed)"
Msg.Subject = "Subject"
Msg.Body = "Message"
System.Web.Mail.SmtpMail.SmtpServer = "smtpserver"
System.Web.Mail.SmtpMail.Send(Msg)


Let us know if this works?
 

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

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top