Link to home
Start Free TrialLog in
Avatar of Websnaky
Websnaky

asked on

Send mails via Authsmtp using a visual Basic programm (VB6)

Helllo

I am looking for an exemple on how to send an email from a VB6 program using the smtp server 'authsmtp' and without using an email client like Outlook etc
Authsmtp website = www.authsmtp.com
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

example code VB.NET attached
You MUST use VB6 ?!
Private Sub Page_Load(sender As Object, e As System.EventArgs)
   Dim mail As New MailMessage()
   mail.To = "me@mycompany.com"
   mail.From = "you@yourcompany.com"
   mail.Subject = "this is a test email."
   mail.Body = "Some text goes here"
   mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
   mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here") 'set your username here
   mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret") 'set your password here
   SmtpMail.SmtpServer = "mail.mycompany.com" 'your real server goes here
   SmtpMail.Send(mail)
End Sub 'Page_Load

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of DeltaR7
DeltaR7
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial