drifter213 Posted March 15, 2016 Share Posted March 15, 2016 Hey guys, I am currently trying to send a mail with an AutoIT script Code: #include <Inet.au3> #include <MsgBoxConstants.au3> Local $s_SmtpServer = "smtp.gmail.com" Local $s_FromName = "TEST" Local $s_FromAddress = "*@gmail.com" Local $s_ToAddress = "*@gmail.com" Local $s_Subject = "TEST" Local $as_Body[2] $as_Body[0] = "Testmail" $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 But I am getting this error: What am I doing wrong? Link to comment Share on other sites More sharing options...
Developers Jos Posted March 16, 2016 Developers Share Posted March 16, 2016 Gmail is using secure SMTP so the regular _INetSmtpMail() will not work. Search the forum for _INetSmtpMailCom() which will work. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
drifter213 Posted March 16, 2016 Author Share Posted March 16, 2016 3 hours ago, Jos said: Gmail is using secure SMTP so the regular _INetSmtpMail() will not work. Search the forum for _INetSmtpMailCom() which will work. Jos Thanks for you reply! I tried to use your _INetSmtpMail() script form here: Now I am getting this error msg; I have edited only this part: ;################################## ; Variables ;################################## $SmtpServer = "smtp.gmail.com" ; address for the smtp-server to use - REQUIRED $FromName = "Test" ; name from who the email was sent $FromAddress = "*@gmail.com" ; address from where the mail should come $ToAddress = "*@gmail.com" ; destination address of the email - REQUIRED $Subject = "TESTMAIL" ; subject from the email - can be anything you want it to be $Body = "TESTMAIL" ; the messagebody from the mail - can be left blank but then you get a blank mail $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed $CcAddress = "" ; address for cc - leave blank if not needed $BccAddress = "" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = "*@gmail.com" ; username for the account used from where the mail gets sent - REQUIRED $Password = "*" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 465 ; port used for sending the mail $ssl = 1 ; enables/disables secure socket layer sending - put to 1 if using httpS ;~ $IPPort=465 ; GMAIL port used for sending the mail ;~ $ssl=1 ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS Link to comment Share on other sites More sharing options...
drifter213 Posted March 16, 2016 Author Share Posted March 16, 2016 Just tried another provider and there it is working... I don't need help with this anymore, thanks for your script! 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