Jump to content
Sign in to follow this  
AlmarM

_INetSmtpMail Help

Recommended Posts

AlmarM

Hi,

Im trying to use _INetSmtpMail but it keeps failling with error '4'.

@ERROR = 4 - Unable to create socket

Here's what im using:

#include <INet.au3>

$s_Server = "smtp.live.com"
$s_FromName = "AlmarM"
$s_FromAddress = "worker1@live.nl"
$s_ToAddress = "worker2@live.nl"
$s_Subject = "Test"
Dim $s_Body[4]
$s_Body[0] = "Test1"
$s_Body[1] = "Test2"
$s_Body[2] = "Test3"
$s_Body[3] = "Test4"

$Response = _INetSmtpMail($s_Server, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $s_Body)
$err = @error

If $Response = 1 Then
    MsgBox(0, "", "Done")
Else
    MsgBox(0, "", "Fail with: " & $err)
EndIf

How to fix this :)

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
rogdog

I have tried the code using my work smtp settings and it doesn't seem work for me either. Sorry but can't see what we are doing wrong :-(


My Scripts[topic="73325"]_ReverseDNS()[/topic]Favourite scripts by other members[topic="81687"]SNMP udf[/topic][topic="70759"]Using SNMP - MIB protocol[/topic][topic="39050"]_SplitMon:Section off your monitor!, split your monitor into sections for easy management[/topic][topic="73425"]ZIP.au3 UDF in pure AutoIt[/topic][topic="10534"]WMI ScriptOMatic tool for AutoIt[/topic][topic="51103"]Resources UDF embed/use any data/files into/from AutoIt compiled EXE files[/topic]

Share this post


Link to post
Share on other sites
AlmarM

I dont think im doing something wrong, mayby its the connection... What could it be?

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
rogdog

Hi AlmarM,

Just had another play with _INetSmtpMail() and got a bit further.

I realised that my antivirus software (McAfee) is set to block smtp traffic by default. However, once I removed the block I received error message 50 instead of 4

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

It would be worth you checking any antivirus/firewall products you have that might be blocking the smtp connection


My Scripts[topic="73325"]_ReverseDNS()[/topic]Favourite scripts by other members[topic="81687"]SNMP udf[/topic][topic="70759"]Using SNMP - MIB protocol[/topic][topic="39050"]_SplitMon:Section off your monitor!, split your monitor into sections for easy management[/topic][topic="73425"]ZIP.au3 UDF in pure AutoIt[/topic][topic="10534"]WMI ScriptOMatic tool for AutoIt[/topic][topic="51103"]Resources UDF embed/use any data/files into/from AutoIt compiled EXE files[/topic]

Share this post


Link to post
Share on other sites
Yorn

Also, check with your ISP to verify they do not block SMTP traffic as well.

Share this post


Link to post
Share on other sites
AlmarM

Also, check with your ISP to verify they do not block SMTP traffic as well.

How do I check it?

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
AlmarM

Hi AlmarM,

Just had another play with _INetSmtpMail() and got a bit further.

I realised that my antivirus software (McAfee) is set to block smtp traffic by default. However, once I removed the block I received error message 50 instead of 4

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

It would be worth you checking any antivirus/firewall products you have that might be blocking the smtp connection

Oh my Firewall is down and I dont have any anti-virus installed.

AlmarM

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.