Jump to content

Recommended Posts

Posted

I'm trying to send an email but I have no luck, always getting this error "Error code 50" from the example script.

 

#include <Inet.au3>
#include <MsgBoxConstants.au3>

Local $s_SmtpServer = "smtp.gmail.com"
Local $s_FromName = "My Name"
Local $s_FromAddress = "example@gmail.com"
Local $s_ToAddress = "example2@gmail.com"
Local $s_Subject = "My Test UDF"
Local $as_Body[2]
$as_Body[0] = "Testing the new email udf"
$as_Body[1] = "Second Line"
Local $iResponse = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, "EHLO " & @ComputerName, -1, 1)
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
Allow less secure apps on gmail is ON

 

AUTOIT.PNG

Posted
7 minutes ago, Jos said:

Look for _INetSmtpMailCom in examples as the standard _INetSmtpMail() doensn't support  secure email used by Gmail.

Jos

Okay. What smtp server does it support? thanks in advance.

  • 4 weeks later...
Posted

Hello, I get this same error. The weird thing is that I get this error when trying to run this on a newer version of AutoIT. I have older scripts that I run with the exact same code and they still work fine.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...