Jump to content

problems with _INetSmtpMail


Tiger
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 years later...

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.

Link to comment
Share on other sites

  • Developers

$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?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 1 year later...
  • 5 weeks later...
  • 5 years later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...