Sign in to follow this  
Followers 0
evil_dave

_INetSmtpMail error 50

8 posts in this topic

Hiya,

i have having a problem with a smal script i have:

global $s_SmtpServer = "192.168.1.2"   [This is the internal address of my SMTP server, which works fine through telnet on port 25]
global $s_FromName = "My Name"
global $s_FromAddress = "email@here.com"
global $s_ToAddress = "email@here.com"
global $s_Subject = "MySubject"

Func _EmailLog($report)
    Dim $as_Body[1]
    $as_Body[0] = "$report"
    $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
    $err = @error
    If $Response = 1 Then
        FileWriteLine($Name_Of_Log_File, @HOUR & ":" & @MIN & ":" & @SEC & " " & @MDAY & "/" & @MON & "/" & @YEAR & ": Sucess: Report Email Sent OK" & @CRLF)
    Else
        FileWriteLine($Name_Of_Log_File, @HOUR & ":" & @MIN & ":" & @SEC & " " & @MDAY & "/" & @MON & "/" & @YEAR & ": Error: Could not send report email: " & $err & @CRLF)
    EndIf

EndFunc

_EmailLog("text to go in email")

The error i'm getting in my little log file is: Error: Could not send report email: 50 (50 being the error code)

It shows in the helpfile that:

@ERROR = 5x - Cannot open SMTP session. x indicates the index number of last command issued to the SMTP server.

however i'm not sure how to correct this. can anyone have any thought? any help would be very welcome.

Thanks for your time,

David

Share this post


Link to post
Share on other sites



Cant you just use localhost?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

help file...

Smtp server the eMail is to be sent though May be either alpha or a numeric IP address. In order to fight spam, many ISPs require this to be their server. eg "smtp.ispdomain.com", "mail.ispdomain.com" or "192.168.1.1"

might try one of the ISPdomain ones...

just my 2cents, although I wouldn't know how to help...

:whistle:

I'm adding to the thread because I constantly keep getting "@ERROR = 4 - Unable to create socket". and I have know Idea what that is. I'm in the same boat.

any one willing to save the ;) newB's

thanx


FileMove(".\Bones8185.newB", ".\Bones8185.adv")

Share this post


Link to post
Share on other sites

He is using his own smtp server, Not an isp.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Hiya,

thanks for the replys.

I cannot use localhost, in answer to your question because i do not have SMTP installed on my local computer. I have a Windows Server 2003 Standard which is at 192.168.1.2 which is why i use this IP.

This email will not be going to the outside, only for internal use, so spam etc is not a problem.

I've still not had any luck, so any more thoughts\ideas are very welcome.

Bones8185: your most likey getting a socket error because somthing else is bound to the port its trying to use. Check your not using a firewall which is blocking your connectiom attempt. Also check what ports are in use on your machine by going Start > Run > type 'cmd' > click 'OK' > type 'netstat -a' It will show you all current connections and ports in use.

Thanks for your time,

David.

Share this post


Link to post
Share on other sites

When I do netstat -a a window comes up and has about 20 lines or so of TCP ...

But it closes instantly

I dont need to fix anything but why is it closing once the list is complete? (unless its just crashing while its being created...)

Share this post


Link to post
Share on other sites

When I do netstat -a a window comes up and has about 20 lines or so of TCP ...

But it closes instantly

I dont need to fix anything but why is it closing once the list is complete? (unless its just crashing while its being created...)

Youve prolly got a virus thingo. Ive got it too, It replaces your stuff with corrupt ones, Try netstat.exe -a

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

When I do netstat -a a window comes up and has about 20 lines or so of TCP ...

But it closes instantly

I dont need to fix anything but why is it closing once the list is complete? (unless its just crashing while its being created...)

Are you running it from the command prompt or from the Run window ?

Youve prolly got a virus thingo. Ive got it too, It replaces your stuff with corrupt ones, Try netstat.exe -a

:whistle: are you sure ?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  
Followers 0