Support - Knowledge base

Giving you the answers you need

Why not try our knowledge base for instant help and advice to enhance your online experience with Register365? From within the knowledge base you can browse our frequently asked questions and find the right answers to help solve your queries.

Home  >  Legacy H-Sphere Hosting  >  Scripting  >  View Article

How to send emails using NET 2.0 and SMTP authorisation.

3*3*3*3*3*

Article

NOTE: This document only applies to customers hosted on legacy Register365 services!

If you want to send mails by our servers with SMTP authorisation use this code.

Dim smtpserver, username, pass As String
Dim cdobasic, cdosendusingport As Integer
Dim mojMail As New System.Web.Mail.MailMessage()
Dim objSmtpServer As System.Web.Mail.SmtpMail
smtpserver = "mail server address here"
username = "username (email address here)"
pass = "password here"
cdobasic = 1
cdosendusingport = 2
myMail.Fields("http://schemas.microsoft.com/cdo/
configuration/smtsperver") = smtpserver
myMail.Fields("http://schemas.microsoft.com/cdo/
configuration/smtpserverport") = 25
myMail.Fields("http://schemas.microsoft.com/cdo/
configuration/sendusing") = cdosendusingport
myMail.Fields("http://schemas.microsoft.com/cdo/
configuration/smtpauthenticate") = cdobasic
myMail.Fields("http://schemas.microsoft.com/cdo/
configuration/sendusername") = username
myMail.Fields("http://schemas.microsoft.com/cdo/
configuration/sendpassword") = pass
myMail.From = "from email address"
myMail.To = "to email address"
myMail.Subject = "email subject here"
myMail.Body = "email body here"
objSmtpServer.SmtpServer = smtpserver
objSmtpServer.Send(myMail)

If you still have problems with sending mail, add also SPF record to DNS configuration of your domain name.

Rate This Article

How useful was this article?

Not useful A little useful Useful Very useful Everything I needed