Sign in to follow this  
Followers 0
Tiger

problems with _INetSmtpMail

9 posts in this topic

I have a problem with this example:

#include <INet.au3>

$s_SmtpServer = "mysmtpserver.com.au"
$s_FromName = "My Name"
$s_FromAddress = "From eMail Address"
$s_ToAddress = "To eMail Address"
$s_Subject = "My Test UDF"
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, $as_Body)
$err = @error
If $Response = 1 Then
    MsgBox(0, "Success!", "Mail sent")
Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
EndIf

Error: ""Mail failed with error code 50"

@ERROR = 50x - Cannot send body. x indicates the line number of $as_Body (first line is 0)."


My UDFs:- _RegEnumKey

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Check for valid smtp server

@ERROR = 5x - Cannot open SMTP session. x indicates the index number of last command issued to the SMTP server.

Also try setting $b_trace to see the smtp session dialog

$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @ComputerName, -1, 1)

Also check that your firewall is not preventing outgoing smtp connection.

Edited by picaxe

Share this post


Link to post
Share on other sites

OK. I use the the smtp-server from a company.


My UDFs:- _RegEnumKey

Share this post


Link to post
Share on other sites

OK. I use the the smtp-server from a company.

Did you ever figure out what was causing this? I'm trying to do something similar for my company and I'm getting the exact same thing. "Mail failed with error code 50"

Help?

Share this post


Link to post
Share on other sites

Did you ever figure out what was causing this? I'm trying to do something similar for my company and I'm getting the exact same thing. "Mail failed with error code 50"

Help?

$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @ComputerName, -1, 0) should work without opening a dialog box with the SMTP connection info.

Share this post


Link to post
Share on other sites

$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @ComputerName, -1, 0) should work without opening a dialog box with the SMTP connection info.

What is the point of this reply to a 2.5 year old post?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

What is the point of this reply to a 2.5 year old post?

Because you never know if someone will come along several years later and find the answer he was looking for. :)

Share this post


Link to post
Share on other sites

Im glad he did update even after 2.5 years later, what he posted just solved my very same issue!

Share this post


Link to post
Share on other sites

#9 ·  Posted

The solution from CityOfNashua  worked for me. Great and Thanks !!!!

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