Jump to content
Sign in to follow this  
prgwkp

SMTP Email Problem

Recommended Posts

prgwkp

Does anyone see anything wrong with this? The email does not send and I get an error of "Mail failed with error code 50". From the Help guide, this seems to be a problem with the body. I have even tried removing the code for the body, still same error.

#include <Inet.au3>
Local $s_SmtpServer = "mailrelay.XXX.XXX"
Local $s_FromName = "prgwkp"
Local $s_FromAddress = "XXX@Server.com"
Local $s_ToAddress = "XXXXX@XXX.com"
Local $s_Subject = "Subject Test"
Local $as_Body[2]
$as_Body[0] = "Body Test"
$as_Body[1] = "Second Line"
Local $Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
Local $err = @error
If $Response = 1 Then
    MsgBox(0, "Success!", "Mail sent")
Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
EndIf

Share this post


Link to post
Share on other sites
prgwkp

After looking at the error code 50 again in the Help files, its 5x, where x is the last command issues, so apparently its not opening the SMTP session. I know the SMTP info is correct, any thoughts on why it would not open it?

Share this post


Link to post
Share on other sites
NATO

What was the solution? I'm running into a similar issue.

Share this post


Link to post
Share on other sites
JLogan3o13

Hi, Nato. If you would like to post your code, we can do our best to assist :oops:


√-1 2^3 ∑ π, and it was delicious!

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  

×