Jump to content

error 50 in _Inetsmtpmail function

Recommended Posts

need code to help.. or are you just getting an error with no code??


#include <INet.au3>

$s_SmtpServer = ""

$s_FromName = "ravi_qa"

$s_FromAddress = "ravi@gmail.com"

$s_ToAddress = "honest@yahoo.com"

$s_Subject = "testing smtp"

Dim $as_Body[2]

$as_Body[0] = "autoit"

$as_Body[1] = "it's working"

$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")


MsgBox(0, "Error!", "Mail failed with error code " & $err)


Link to post
Share on other sites

I am also interested to know if there is a fix for this.

I also observed that when I restart my PC and run the same script above, it will work on the first execution. After that an error 50 is returned.

You'll have to restart the PC again to make it work.

I guess this has something to do with the smtp session.. Just a suspicion.

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

    No registered users viewing this page.

  • Create New...