Jump to content

Recommended Posts

Posted

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
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
  • 2 weeks later...
Posted

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?

  • 2 years later...
Posted

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.

  • Developers
Posted

$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.
  :)

  • 1 year later...
Posted

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. :)

  • 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
  • Recently Browsing   0 members

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