tannerli Posted March 19, 2008 Share Posted March 19, 2008 hi guys I want to build a notification for my script which sends an email on errors. I tried the UDF with the example from the helpfile: #include <INet.au3> $s_SmtpServer = "srvxxxx.yyy.com" $s_FromName = "tannerli" $s_FromAddress = "zzz@yyy.com" $s_ToAddress = "ppp@yyy.com" $s_Subject = "My Test UDF" Dim $as_Body[1] $as_Body[0] = "Testing the new email udf" $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body) $err = @error If $Response = 1 Then MsgBox(0, "Success!", "Mail sent") Else MsgBox(0, "Error!", "Mail failed with error code " & $err) EndIf But it always fails with errorcode 50 ("Unable to send body"). The server adress is right and im also privileged to send mail over that server. Ideas? Link to comment Share on other sites More sharing options...
fielmann Posted March 19, 2008 Share Posted March 19, 2008 hi guys I want to build a notification for my script which sends an email on errors. I tried the UDF with the example from the helpfile: #include <INet.au3> $s_SmtpServer = "srvxxxx.yyy.com" $s_FromName = "tannerli" $s_FromAddress = "zzz@yyy.com" $s_ToAddress = "ppp@yyy.com" $s_Subject = "My Test UDF" Dim $as_Body[1] $as_Body[0] = "Testing the new email udf" $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body) $err = @error If $Response = 1 Then MsgBox(0, "Success!", "Mail sent") Else MsgBox(0, "Error!", "Mail failed with error code " & $err) EndIf But it always fails with errorcode 50 ("Unable to send body"). The server adress is right and im also privileged to send mail over that server. Ideas? I had the same problem! On my search I have found the example-script "TCP_SendEmail.au3" (see attachment). It works without problems! Try it TCP_SendEmail.au3 Link to comment Share on other sites More sharing options...
tannerli Posted March 19, 2008 Author Share Posted March 19, 2008 Great! This function really works without problems Thx for your help 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