se7en Posted November 22, 2009 Share Posted November 22, 2009 Can anyone please tell me how to send email using autoit? Link to comment Share on other sites More sharing options...
PartyPooper Posted November 22, 2009 Share Posted November 22, 2009 (edited) Try adding something like this to your code: ; #FUNCTION# ======================================================================================================================================================= ; Name...........: OpenEmail ; Description ...: Opens the default emailer passing to it the subject and body if filled in. ; Syntax.........: OpenEmail([$sSubject, [$sBody]]) ; Parameters ....: $sEmail - Email Address ; $sSubject - The subject header (optional) ; $sBody The text of the email (optional) ; Requirement(s).: #include <INet.au3> and an email program must be installed for it to be successful ; Return values .: ; Remarks .......: ; Related .......: ; ================================================================================================================================================================== #include <INet.au3> Global $sEmail, $sSubject, $sBody Func OpenEmail($sSubject = "", $sBody = "") _INetMail($sEmail, $sSubject, $sBody) If @error Then Msgbox(0,'',"FAIL') Return EndFunc ;==>OpenEmail Edited November 22, 2009 by PartyPooper Link to comment Share on other sites More sharing options...
MirnesC2 Posted November 22, 2009 Share Posted November 22, 2009 #include <INet.au3> $Address = InputBox('Address', 'Enter the E-Mail address to send message to') $Subject = InputBox('Subject', 'Enter a subject for the E-Mail') $Body = InputBox('Body', 'Enter the body (message) of the E-Mail') 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)) (this one didn't seem to work for me) OR #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 (haven't tried it) Link to comment Share on other sites More sharing options...
se7en Posted November 22, 2009 Author Share Posted November 22, 2009 yeah I know this they are on the help, but thanks for your reply guys! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now