Jump to content

_INetSmtpMail Error code 50


 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 weeks later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...