Orlina Posted April 15, 2022 Share Posted April 15, 2022 Dear All, Please help to solve the very simple issue with sending the email message with attacment. I have found such code and made it work for out SMTP server. Simple mail can be sent, but when I am trying to attache the file, it gives the error 50. here is my code : #include <Inet.au3> #include <MsgBoxConstants.au3> #include <File.au3> $s_SmtpServer = "smtp.services.mail.net" $s_FromName = "artiom oriol" $s_FromAddress = "artiom.oriol@mail.com" $s_ToAddress = "artiom.oriol@mail.com" $s_Subject = "My Test UDF" $AttachFiles = "C:\Users\artiom.oriol\Desktop\testFile.txt" 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, $AttachFiles, $as_Body, -1) $err = @error If $Response = 1 Then MsgBox(0, "Success!", "Mail sent") Else MsgBox(0, "Error!", "Mail failed with error code " & $err) EndIf Thank you in advance. Best regards! Link to comment Share on other sites More sharing options...
Nine Posted April 15, 2022 Share Posted April 15, 2022 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Developers Jos Posted April 15, 2022 Developers Share Posted April 15, 2022 Moved to the appropriate AutoIt General Help and Support forum, as the AutoIt Example Scripts forum very clearly states: Quote Share your cool AutoIt scripts, UDFs and applications with others. Do not post general support questions here, instead use the AutoIt Help and Support forums. Moderation Team 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...
Skeletor Posted April 20, 2022 Share Posted April 20, 2022 @Nine By the way, does this of script Jos guarantee secure connections to SMTP servers. Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI Link to comment Share on other sites More sharing options...
Nine Posted April 20, 2022 Share Posted April 20, 2022 Better ask @Jos ? Skeletor 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Developers Jos Posted April 20, 2022 Developers Share Posted April 20, 2022 32 minutes ago, Skeletor said: @Nine By the way, does this of script Jos guarantee secure connections to SMTP servers. When the "CDO.message" com object from Microsoft comes with any guarantees then I would say yes, but that is what is used, so you need to search for that when you have any specific questions, as the script is simply a wrapper for that object. 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...
Skeletor Posted April 20, 2022 Share Posted April 20, 2022 6 minutes ago, Jos said: When the "CDO.message" com object from Microsoft comes with any guarantees then I would say yes, but that is what is used, so you need to search for that when you have any specific questions, as the script is simply a wrapper for that object. Jos Didn't know.. but now I know... thanks Jos. Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI 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