Jump to content
Sign in to follow this  

INet mail sending problem

Recommended Posts


I used both the smpt and regular mail examples from the help files and neither worked.

#include <INet.au3>

$s_SmtpServer = "smtp.gmail.com"
$s_FromName = "Mirnes"
$s_FromAddress = "MirnesC92@gmail.com"
$s_ToAddress = "MirnesC92@gmail.com"
$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)

Returns error msg 50 with no email sent.

#include <INet.au3>

$Address = InputBox('Address', 'Enter the E-Mail address to send message to') ;mirnesc92@gmail.com
$Subject = InputBox('Subject', 'Enter a subject for the E-Mail') ;test
$Body = InputBox('Body', 'Enter the body (message) of the E-Mail') ;test
MsgBox(0,'E-Mail has been opened','The E-Mail has been opened and process identifier for the E-Mail client is ' & _INetMail($address, $subject, $body))

Returns 0 for failure, no email sent

Share this post

Link to post
Share on other sites

Yup, your example worked! Tanks!!


Edited by MirnesC2

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