Jump to content
Arlen

_INetSmtpMail Error code 50

Recommended Posts

Arlen

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

Share this post


Link to post
Share on other sites
Jos

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

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Arlen
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.

Share this post


Link to post
Share on other sites
Arlen
25 minutes ago, Arlen said:

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

NVM thanks

Share this post


Link to post
Share on other sites
MWIDNER21

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.

Share this post


Link to post
Share on other sites

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

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.