Jump to content

How to send emails & need example


Recommended Posts

Hi,

How to send the email using autoit

and need some examples ...

thanks in advance .........?

i use this code but it shows error 3 unable to resolve ip ....i connect my pc through proxy server is there any problem ..........

#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")
Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
EndIf
Edited by Gobinath
Link to comment
Share on other sites

$From = "" 
$objEmail = ObjCreate("CDO.Message") 
$objEmail.From = "" 
$objEmail.To = "" 
$objEmail.Subject = "" 
$objEmail.Textbody = $TextBody 
$objEmail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
$objEmail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _ 
"SMPT IP ADDRESS" ; <--------------------------------------------------- CONFIGURE YOUR SMPT SERVER CORRECTLY! 
$objEmail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
$objEmail.Configuration.Fields.Update 
$objEmail.Send
I found this function from one of the forum. This simple script may help you!

Edited by Syed23

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

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...