Jac Posted January 15, 2009 Share Posted January 15, 2009 Hi im trying to use autoit to send email with our smtp server. My pc is authorize to send email with the server and i tested it with this software "MultiMail2" and it's working just fine but not with autoit Here is the code $s_SmtpServer = "192.168.x.x" $s_FromName = "TEST" $s_FromAddress = "test@domainname.qc.ca" $s_ToAddress = "test@domainname.qc.ca" $s_Subject = "test" Dim $as_Body[2] $as_Body[0] = "The file " & $FileName & " is out of date" $as_Body[1] = "Second Line" $Resultat = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body) $err = @error If $Resultat = 1 Then MsgBox(0, "Success!", "Mail sent") Else MsgBox(0, "Error!", "Mail failed with error code " & $err) EndIf I always received error code "Mail failed with error code 50" Any help please Thanks ! Link to comment Share on other sites More sharing options...
SpookMeister Posted January 15, 2009 Share Posted January 15, 2009 (edited) Look at the $s_first parameter for _INetSmtpMail(). I found that my mail server required the -1 value that the help file mentioned. $s_SmtpServer = "192.168.x.x" $s_FromName = "TEST" $s_FromAddress = "test@domainname.qc.ca" $s_ToAddress = "test@domainname.qc.ca" $s_Subject = "test" Dim $as_Body[2] $as_Body[0] = "The file " & $FileName & " is out of date" $as_Body[1] = "Second Line" $Resultat = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @ComputerName, -1) $err = @error If $Resultat = 1 Then MsgBox(0, "Success!", "Mail sent") Else MsgBox(0, "Error!", "Mail failed with error code " & $err) EndIf Edited January 15, 2009 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
Jac Posted January 15, 2009 Author Share Posted January 15, 2009 Thanks it worked ! Look at the $s_first parameter for _INetSmtpMail(). I found that my mail server required the -1 value that the help file mentioned. $s_SmtpServer = "192.168.x.x" $s_FromName = "TEST" $s_FromAddress = "test@domainname.qc.ca" $s_ToAddress = "test@domainname.qc.ca" $s_Subject = "test" Dim $as_Body[2] $as_Body[0] = "The file " & $FileName & " is out of date" $as_Body[1] = "Second Line" $Resultat = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @ComputerName, -1) $err = @error If $Resultat = 1 Then MsgBox(0, "Success!", "Mail sent") Else MsgBox(0, "Error!", "Mail failed with error code " & $err) EndIf Link to comment Share on other sites More sharing options...
BJJ Posted February 1, 2009 Share Posted February 1, 2009 Can u put full code for send email ?? Link to comment Share on other sites More sharing options...
Minikori Posted February 1, 2009 Share Posted February 1, 2009 Can u put full code for send email ??You might want to take a look at this. For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
BrettF Posted February 1, 2009 Share Posted February 1, 2009 Erm may I ask why that matters? this is a support topic, and I think hes asking for the correct result... In that case he should use the infamous search feature... Cheers, Brett 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...
Minikori Posted February 1, 2009 Share Posted February 1, 2009 Erm may I ask why that matters? this is a support topic, and I think hes asking for the correct result... In that case he should use the infamous search feature...Cheers,BrettYeah, I guess your right.@Quzziy: I use to have this Email GUI I got from the example scripts section, but I just searched and couldn't find it. For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
CodyBarrett Posted March 10, 2009 Share Posted March 10, 2009 (edited) You might want to take a look at this.uhhh just incase you didnt notice (if your warning him that is) he never actually DID say whether or not the source was 'not for our eyes' so yeah.... Edited March 10, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
BrettF Posted March 10, 2009 Share Posted March 10, 2009 Why did you bother to post on a 1 month old topic... 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...
CodyBarrett Posted March 10, 2009 Share Posted March 10, 2009 because i was researching this function for myself.... and this overreaction\missunderstanding was bugging me :\ [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] 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