Jex Posted November 24, 2007 Share Posted November 24, 2007 (edited) I'm added gui for Jos's Smtp UDFexpandcollapse popup#Include <File.au3> #include <GUIConstants.au3> #include <String.au3> Global $s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $s_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl, $oMyRet[2], $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $Width = 322 $Height = 382 $Form = GUICreate("Mail Sender", $Width, $Height, -1, -1, BitOR($WS_POPUP, $WS_BORDER)) $Close = GUICtrlCreateLabel("X", $Width - 15, 0, 11, 20) GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetCursor(-1, 0) $Other = GUICtrlCreateLabel("+", $Width - 30, 0, 11, 20) GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetCursor(-1, 0) $Formtitle = GUICtrlCreateLabel(" Mail Sender", 0, 4, @DesktopWidth, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $Formtitlebackground = GUICtrlCreateGraphic(0, 0, @DesktopWidth, 22) GUICtrlSetBkColor(-1, 0x000000) $Edit1 = GUICtrlCreateEdit("", 8, 76, 305, 265) $Input1 = GUICtrlCreateInput("", 56, 28, 257, 21) $Input2 = GUICtrlCreateInput("", 56, 52, 257, 21) $Label1 = GUICtrlCreateLabel("To :", 8, 30, 23, 17) $Label2 = GUICtrlCreateLabel("Subject :", 8, 54, 46, 17) $Button1 = GUICtrlCreateButton("Send", 8, 348, 150, 25, 0) $Button2 = GUICtrlCreateButton("Settings", 167, 348, 147, 25, 0) $Width2 = 263 $Height2 = 217 $Form2 = GUICreate("Settings", $Width2, $Height2, -1, -1, BitOR($WS_POPUP, $WS_BORDER)) $Close2 = GUICtrlCreateLabel("X", $Width2 - 15, 0, 11, 20) GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetCursor(-1, 0) $Formtitle2 = GUICtrlCreateLabel(" Settings", 0, 4, @DesktopWidth, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $Formtitlebackground2 = GUICtrlCreateGraphic(0, 0, @DesktopWidth, 22) GUICtrlSetBkColor(-1, 0x000000) $Label12 = GUICtrlCreateLabel("Smtp Server :", 16, 32, 68, 17) $Label22 = GUICtrlCreateLabel("From name :", 16, 128, 62, 17) $Label32 = GUICtrlCreateLabel("From address :", 16, 152, 73, 17) $Label42 = GUICtrlCreateLabel("Username :", 16, 80, 58, 17) $Label52 = GUICtrlCreateLabel("Password :", 16, 104, 56, 17) $Label62 = GUICtrlCreateLabel("Port :", 16, 56, 29, 17) $Label72 = GUICtrlCreateLabel("SSL :", 120, 56, 30, 17) $Input12 = GUICtrlCreateInput("", 96, 32, 121, 21) $Input22 = GUICtrlCreateInput("", 56, 56, 49, 21) $Input32 = GUICtrlCreateInput("", 96, 80, 121, 21) $Input42 = GUICtrlCreateInput("", 96, 104, 121, 21, $ES_PASSWORD) $Input52 = GUICtrlCreateInput("", 96, 128, 121, 21) $Input62 = GUICtrlCreateInput("", 96, 152, 121, 21) $Checkbox1 = GUICtrlCreateCheckbox("Enable / Disable", 152, 56, 97, 17) $Button12 = GUICtrlCreateButton("Apply Settings", 16, 184, 83, 25, 0) $Button22 = GUICtrlCreateButton("Apply and Save Settings", 112, 184, 131, 25, 0) $Width3 = 283 $Height3 = 115 $Form3 = GUICreate("Options", $Width3, $Height3, -1, -1, BitOR($WS_POPUP, $WS_BORDER)) $Close3 = GUICtrlCreateLabel("X", $Width3 - 15, 0, 11, 20) GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetCursor(-1, 0) $Formtitle3 = GUICtrlCreateLabel(" Options", 0, 4, @DesktopWidth, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $Formtitlebackground3 = GUICtrlCreateGraphic(0, 0, @DesktopWidth, 22) GUICtrlSetBkColor(-1, 0x000000) $Label13 = GUICtrlCreateLabel("Cc :", 16, 34, 23, 17) $Label23 = GUICtrlCreateLabel("Bcc", 16, 59, 23, 17) $Label33 = GUICtrlCreateLabel("Attach :", 16, 82, 41, 17) $Input13 = GUICtrlCreateInput("", 64, 32, 201, 21) $Input23 = GUICtrlCreateInput("", 64, 56, 201, 21) $Input33 = GUICtrlCreateInput("", 64, 80, 121, 21) $Button13 = GUICtrlCreateButton("Browse", 192, 80, 75, 25, 0) GUISetState(@SW_SHOW, $Form) Load() While 1 $msg = GUIGetMsg() Switch $msg Case $Close Save() Exit Case $Button1 GUICtrlSetState($Button1, $GUI_DISABLE) GUICtrlSetData($Button1, "Loading...") $s_ToAddress = GUICtrlRead($Input1) $s_Subject = GUICtrlRead($Input2) $s_Body = GUICtrlRead($Edit1) $s_CcAddress = GUICtrlRead($Input13) $s_BccAddress = GUICtrlRead($Input23) $s_AttachFiles = GUICtrlRead($Input33) $Send = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $s_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl) If @error Then MsgBox(0, "Error sending message", "Error code:" & @error & " Rc:" & $Send) GUICtrlSetData($Button1, "Send") GUICtrlSetState($Button1, $GUI_ENABLE) Case $Button2 GUISetState(@SW_SHOW, $Form2) Case $Other GUISetState(@SW_SHOW, $Form3) Case $Close2 GUISetState(@SW_HIDE, $Form2) Case $Button12 Apply() Case $Button22 Save() Case $Button13 $File = FileOpenDialog('Please choose file', '', 'All files (*.*)', 1) GUICtrlSetData($Input33, $File) Case $Close3 GUISetState(@SW_HIDE, $Form3) EndSwitch WEnd Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $s_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0) $objEmail = ObjCreate("CDO.Message") $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr($s_Body, "<") And StringInStr($s_Body, ">") Then $objEmail.HTMLBody = $s_Body Else $objEmail.Textbody = $s_Body & @CRLF EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) If FileExists($S_Files2Attach[$x]) Then $objEmail.AddAttachment($S_Files2Attach[$x]) Else $i_Error_desciption = $i_Error_desciption & @LF & 'File not found to attach: ' & $S_Files2Attach[$x] SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort If $s_Username <> "" Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf If $ssl Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True EndIf $objEmail.Configuration.Fields.Update $objEmail.Send If @error Then SetError(2) Return $oMyRet[1] EndIf EndFunc ;==>_INetSmtpMailCom Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) $oMyRet[0] = $HexNumber $oMyRet[1] = StringStripWS($oMyError.description, 3) ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF) SetError(1) Return EndFunc ;==>MyErrFunc Func Apply() $s_SmtpServer = GUICtrlRead($Input12) $s_FromName = GUICtrlRead($Input52) $s_FromAddress = GUICtrlRead($Input62) $s_Username = GUICtrlRead($Input32) $s_Password = GUICtrlRead($Input42) $IPPort = GUICtrlRead($Input22) If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then $ssl = "1" Else $ssl = "0" EndIf EndFunc ;==>Apply Func Save() Apply() $Save = _StringEncrypt(1, $s_SmtpServer & "†" & $s_FromName & "†" & $s_FromAddress & "†" & $s_Username & "†" & $s_Password & "†" & $IPPort & "†" & $ssl, "Secret") If FileExists("Settings.txt") Then FileDelete("Settings.txt") FileWrite("Settings.txt", $Save) EndFunc ;==>Save Func Load() If FileExists("Settings.txt") Then $Load = FileRead("Settings.txt") $Decrypt = _StringEncrypt(0, $Load, "Secret") $Settings = StringSplit($Decrypt, "†", 1) GUICtrlSetData($Input12, $Settings[1]) GUICtrlSetData($Input52, $Settings[2]) GUICtrlSetData($Input62, $Settings[3]) GUICtrlSetData($Input32, $Settings[4]) GUICtrlSetData($Input42, $Settings[5]) GUICtrlSetData($Input22, $Settings[6]) If $Settings[7] = "1" Then GUICtrlSetState($Checkbox1, $GUI_CHECKED) Else GUICtrlSetState($Checkbox1, $GUI_UNCHECKED) EndIf Apply() EndIf EndFunc ;==>Load Edited December 26, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
James Posted November 24, 2007 Share Posted November 24, 2007 That looks really nice. *Checks it out* WOW. Holy Turnip. Thats really good! It works so well too. Suggestion time. You should add settings for default emails e.g. GMail, Yahoo etc. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Jex Posted November 24, 2007 Author Share Posted November 24, 2007 Thanks for your comment and suggestion.I know only GMail and Yahoo smtp address and i can't find Hotmail smtp address. I think for 2 email not need add listbox.GMail : smtp.gmail.com or smtp.googlemail.com | 465 or 587 | SSL need ( http://mail.google.com/support/bin/answer.py?answer=13287 )Yahoo : smtp.mail.yahoo.com | 465 | SSL need ( http://help.yahoo.com/l/us/yahoo/mail/orig...pop/pop-30.html ) My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
Valuater Posted November 24, 2007 Share Posted November 24, 2007 Not Bad Jex.... 8) Link to comment Share on other sites More sharing options...
James Posted November 24, 2007 Share Posted November 24, 2007 Hotmail, you cant use as it doesn't allow Pop3. I'm sure of it. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Cyber Posted November 27, 2007 Share Posted November 27, 2007 Good work! Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
Developers Jos Posted November 27, 2007 Developers Share Posted November 27, 2007 (edited) Hotmail, you cant use as it doesn't allow Pop3. I'm sure of it.It needs SMTP or Secure SMTP to send its messages. POP is to retrieve your mail. Edited November 27, 2007 by 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...
JonCross Posted November 27, 2007 Share Posted November 27, 2007 Looks Good Link to comment Share on other sites More sharing options...
Madza91 Posted November 28, 2007 Share Posted November 28, 2007 very simple tnx [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
James Posted November 28, 2007 Share Posted November 28, 2007 Jos, Oh yeah. I forgot that I still don't think that MSN allows that though. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
mikidutza Posted February 14, 2008 Share Posted February 14, 2008 how come i can't copy the code??? try to upload the script!! Link to comment Share on other sites More sharing options...
Aassdd Posted February 14, 2008 Share Posted February 14, 2008 Can be used as a portable email sender good jobMail_Sender.rar Link to comment Share on other sites More sharing options...
bacobampense Posted February 15, 2008 Share Posted February 15, 2008 Very nice! Can you add the option for the user to enter contact information? Also can it send me the pc information that it is coming from? host, ip, mac, user, along with the comments? Link to comment Share on other sites More sharing options...
mikidutza Posted February 15, 2008 Share Posted February 15, 2008 Can be used as a portable email sender good job thx a lot!! Link to comment Share on other sites More sharing options...
BrettF Posted February 15, 2008 Share Posted February 15, 2008 Wow Jex... I like what you can produce! I hope to see more of your great work soon! Keep up the awesome-ness! Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
NELyon Posted February 15, 2008 Share Posted February 15, 2008 Really, and I mean Really nice work! Link to comment Share on other sites More sharing options...
BrettF Posted February 28, 2008 Share Posted February 28, 2008 Really, and I mean Really nice work!Hope you don't mind Jex, but I plan to use the way you've developed your GUI's in this project, into one of mine... bit different though. Gonna add some other things, but I'll post what I can get done with the GUI anway. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Synapse Posted March 10, 2008 Share Posted March 10, 2008 (edited) Nice work....but i have a question...how can i send mail in HTML format? Edited March 10, 2008 by Synapse Link to comment Share on other sites More sharing options...
LinuZ Posted March 10, 2008 Share Posted March 10, 2008 Just so great! I am going to need this! It could be implemented into a program as a bug "tracker" so that the bugs automaticly are stored in a file and then sent throught this! Thanks for posting it!! Link to comment Share on other sites More sharing options...
evg64 Posted March 15, 2008 Share Posted March 15, 2008 How can I send mail from @yahoo.com? Is it possible? How? I really need such a program, but I haven`t managed to send anything yet. 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