I want to send email via Gmail (using AutoIt) but I do not know how to enable TLS. My code returns an error (4):
#include <Inet.au3>
#include <MsgBoxConstants.au3>
#Include<file.au3>
Local $sSMTPServer = "smtp.gmail.com";
Local $sFromName = "Emeka";
Local $sFromAddress = "[email protected]";
Local $sToAddress = "[email protected]";
Local $sSubject = "AuToIT";
Local $aBody[1] = "Test ";
Local $iResponse = _INetSmtpMail($sSMTPServer, $sFromName, $sFromAddress,$sToAddress, $sSubject, $aBody)
Local $iErr = @error
If $iResponse = 1 Then
MsgBox($MB_SYSTEMMODAL, "Success!", "Mail sent")
Else
MsgBox($MB_SYSTEMMODAL, "Error!", "Mail failed with error code " & $iErr)
EndIf
Why is my email not being sent?
_INetSmtpMailfunction slightly to include TLS, not entirely sure how though. - Matt