Search the Community
Showing results for tags '_inetsmtpmail'.
Found 1 result
Trying to send email - failing
azkirak posted a topic in AutoIt General Help and SupportHi all, Trying to test sending an email using the _INetSmtpMail function, but I cannot get it to work. #include <Inet.au3> #include <MsgBoxConstants.au3> Local $s_SmtpServer = "smtp.gmail.com" Local $s_FromName = "My Name" Local $s_FromAddress = "email@example.com" Local $s_ToAddress = "firstname.lastname@example.org" Local $s_Subject = "Test - subject line" Local $as_Body $as_Body = "Test" $as_Body = "End of test" Local $iResponse = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body) 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 "Mail failed with error code 50" is the message I receive. I've looked at what the autoit help page says: 50x - Cannot send body. x indicates the line number of $aBody (first line is 0). I cannot find any solution online that has fixed this issue. Any guidance would be much appreciated!