Jump to content

_INetSmtpMail, I get error 3 from example code what should i do to make it work?


Recommended Posts

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

Local $s_SmtpServer = "mysmtpserver.com.au"
Local $s_FromName = "My Name"
Local $s_FromAddress = "From eMail Address"
Local $s_ToAddress = "To eMail Address"
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)
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
Success: 1.
Failure: 0 and sets the @error flag to non-zero.
@error:

1
2 - Unable to start TCP
3 - Unable to resolve IP
4 - Unable to create socket
5x - Cannot open SMTP session. x indicates the index number of last command issued to the SMTP server.
50x - Cannot send body. x indicates the line number of $aBody (first line is 0).
5000 - Cannot close SMTP session

 

I get error 3 from example code what should i do to make it work?

Edited by Jos
Link to comment
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
 Share

  • Recently Browsing   0 members

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