How to do it: SMTP email using ServerWarp

This is how you can do email verification PIN codes before inserting a person’s account record into a user profile database.

Just tested this and FINALLY got it. The trick is inserting the “New” in the instantiation line, bc otherwise it was breaking at the second line, the Address.

I’m hoping that this saves some other poor soul some frustration, as it’s now 2.35 am in the morning and I’ve been pounding sand on this one since earlier tonight :confused:

Dim smtp As New SMTPSecureSocket
smtp.Address = “mail.serverwarp.com
smtp.Secure = True
smtp.Port = 587
smtp.ConnectionType = SSLSocket.TLSv1
smtp.Username = “email@lltconnect.com
smtp.Password = “passwprd!”

Dim mail As New EmailMessage
mail.FromAddress = “email@lltconnect.com
mail.AddRecipient(variablename)
mail.Subject = “Email Verification PIN.”
Dim tttt As String
tttt = “Your Email Verification PIN is:”+ Str(variable1) + “.”
mail.BodyPlainText = tttt

smtp.Messages.Append(mail)
smtp.SendMail()