Sign in to follow this  
Followers 0
tannerli

InetSmtpMail ?

3 posts in this topic

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?

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

Great!

This function really works without problems

Thx for your help

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0