tom13 Posted April 30, 2007 Share Posted April 30, 2007 (edited) Hi, I have this e-mail script but now I want to add the option to change it's port to 465 and enable SSL so I can use it for gmail, anyone knows how? expandcollapse popupIf FileExists ("Glider.log") Then $file = FileOpen("Glider.log", 0) Else $file = "" EndIf $chars = FileRead($file) FileClose($file) $smtpserver = "" $smtpuser = "" $smtppass = "" $e_Sender = "" $e_Recipient = "" $e_Subject = "hello" $e_Text = "hoi" $e_File = "" SendEmail($e_Sender,$e_Recipient,$e_Subject,$e_Text,$e_File) ; use the function here! Func SendEmail($e_Sender, $e_Recipient, $e_Subject, $e_Text, $e_File) $objMessage = ObjCreate("CDO.Message") With $objMessage .Subject = $e_Subject .Sender = $e_Sender .From = $e_Sender .To = $e_Recipient .TextBody = $e_Text ;.HtmlBody = $e_Text; uncomment to send a HTML mail and comment line above ;.AddAttachment = $e_File ; <== I REMOVED THIS as we don't have an attachment EndWith With $objMessage.Configuration.Fields .Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $smtpserver .Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $smtpuser .Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $smtppass .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587 .Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 .Update EndWith $objMessage.Send Return EndFunc;==>SendEmail EDIT: I forgot to censor my password and username Edited April 30, 2007 by tom13 Link to comment Share on other sites More sharing options...
Developers Jos Posted April 30, 2007 Developers Share Posted April 30, 2007 and STOP making double threads if you are impatient. 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...
Recommended Posts