Knowledge Base

How can I send e-mail through Gmail with ActiveX version (VB6, classic ASP)

Gmail accepts only secure SSL connections, and thus you should use MailBee SMTP component with MailBee SSL/SMIME component.

Visual Basic

Set SMTP = CreateObject("MailBee.SMTP")
set SSL = CreateObject("MailBee.SSL")

SMTP.LicenseKey = "Your SMTP key"
SSL.LicenseKey = "Your SSL key"

Set SMTP.SSL = SSL

SMTP.UserName = "gmail-login"
SMTP.Password = "gmail-password"
SMTP.AuthMethod = 2

SMTP.ServerName = "smtp.gmail.com"

SSL.UseStartTLS = True

SMTP.FromAddr = "user@gmail.com"
SMTP.ToAddr = "joe@company.com"
SMTP.Subject = "Report"

If Not SMTP.Send Then MsgBox SMTP.ErrDesc

ASP

Set SMTP = Server.CreateObject("MailBee.SMTP")
set SSL = Server.CreateObject("MailBee.SSL")

SMTP.LicenseKey = "Your SMTP key"
SSL.LicenseKey = "Your SSL key"

Set SMTP.SSL = SSL

SMTP.UserName = "gmail-login"
SMTP.Password = "gmail-password"
SMTP.AuthMethod = 2

SMTP.ServerName = "smtp.gmail.com"

SSL.UseStartTLS = True

SMTP.FromAddr = "user@gmail.com"
SMTP.ToAddr = "joe@company.com"
SMTP.Subject = "Report"

If Not SMTP.Send Then Response.Write SMTP.ErrDesc