Jump to content
Sign in to follow this  

E-Mail without another program

Recommended Posts


How can I send an e-mail without another program. I would like to send an e-mail to me, then a program has an error

My UDFs:- _RegEnumKey

Share this post

Link to post
Share on other sites

read the help file plase



Sends an email without using an external email program.

#include <INet.au3>

_INetSmtpMail ( $s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress [,$s_Subject [,$as_Body [,$s_helo, [,$s_first [,$b_trace]]]]])


$s_SmtpServer Smtp server the eMail is to be sent though May be either alpha or a numeric IP address. In order to fight spam, many ISPs require this to be their server.

eg "smtp.ispdomain.com", "mail.ispdomain.com" or ""

$s_FromName The name you wish the message to appear to be sent from.

eg "Bob Smith"

$s_FromAddress The email address you wish the message to appear to be sent from.

eg "bob.smith@mydomain.com".

$s_ToAddress The email address the message is to go to.

eg "jane.brown@yourdomain.com"

$s_Subject [optional] The subject of the email.

$as_Body [optional] The body of the email as a single dimensional array of strings. Each value in the array will be terminated with a @CRLF in the email.

$s_helo [optional] identifier for the smtp server connection (by default @ComputerName). If Smtp server require a "EHLO" string just set the string to "EHLO " & @ComputerName.

$s_first [optional] string sent before helo for the smtp server connection (by default {SPACE}). To not send any character this parameter must equal -1, some SMTP server required it.

$b_trace [optional] trace the dialog in a splash window

Return Value

On Success - Returns 1

On Failure - Returns 0 and sets:

@ERROR = 1 - Invalid Parameters

@ERROR = 2 - Unable to start TCP

@ERROR = 3 - Unable to resolve IP

@ERROR = 4 - Unable to create socket

@ERROR = 5x - Cannot open SMTP session. x indicates the index number of last command issued to the SMTP server.

@ERROR = 50x - Cannot send body. x indicates the line number of $as_Body (first line is 0).

@ERROR = 5000 - Cannot close SMTP session


This function sends a email directly through an SMTP server without the use of a third party email client. Requires AutoIt3 v or better.




#include <INet.au3>

$s_SmtpServer = "mysmtpserver.com.au"

$s_FromName = "My Name"

$s_FromAddress = "From eMail Address"

$s_ToAddress = "To eMail Address"

$s_Subject = "My Test UDF"

Dim $as_Body[2]

$as_Body[0] = "Testing the new email udf"

$as_Body[1] = "Second Line"

$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)

$err = @error

If $Response = 1 Then

MsgBox(0, "Success!", "Mail sent")


MsgBox(0, "Error!", "Mail failed with error code " & $err)


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

Sign in to follow this  


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.