Jump to content
Sign in to follow this  
Tiger

problems with _INetSmtpMail

Recommended Posts

Tiger

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
picaxe

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
adickreiter

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
CityOfNashua

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
Jos

$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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
ButtonFury

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
prgwkp

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.