Jump to content

Recommended Posts

Posted

Is he using the same provider ?

In general , providers do not allow message relaying from other domain email addresses or other providers Ip addresses ....

nope. he uses telenet and I use scarlet.

that could indeed be the problem.

Will gmail solve that problem?

what do I need to change then? I just tried with gmail and it didn't work.

got errorcode 2...couldn't connect to server.

  • Developers
Posted

Still not working even with the full path...

did you change this:

Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "Userinfo", $as_Body = "txtfile", $s_AttachFiles = "eu.txt", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "Kreatorul@gmail.com", $s_Password = "mypass",$IPPort=465, $ssl=1)

?

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

Posted (edited)

### COM Error !  Number: 80020009   ScriptLine: 131   Description:The transport failed to connect to the server.
+>AutoIT3.exe ended.rc:0

$s_SmtpServer = "smtp.gmail.com" ; address for the smtp-server to use - REQUIRED
$s_FromName = "Bot-user" ; name from who the email was sent
$s_FromAddress = "your@Email.Address.com" ;  address from where the mail should come
$s_ToAddress = "Overlordtaw@gmail.com" ; destination address of the email - REQUIRED
$s_Subject = "Userinfo" ; subject from the email - can be anything you want it to be
$as_Body = ""; the messagebody from the mail - can be left blank but then you get a blank mail
$s_AttachFiles = "" ; the file you want to attach - leave blank if not needed
$s_CcAddress = "" ; address for cc - leave blank if not needed
$s_BccAddress = "" ; address for bcc - leave blank if not needed
$s_Username = "overlordtaw@gmail.com" ; username for the account used from where the mail gets sent - REQUIRED
$s_Password = "********" ; password for the account used from where the mail gets sent - REQUIRED
$IPPort=465 ; port used for sending the mail
$ssl=1 ; enables/disables secure socket layer sending - put to 1 if using httpS

what's wrong here?

Edited by Overlord
Posted

Is this correct ?

$s_FromAddress = "your@Email.Address.com"

erm, I thought this could be anything that I wanted...

but even when I change it to my correct email-address it even won't work.

  • Developers
Posted

But if I change that back then it gives me this error Description:The transport failed to connect to the server.

and it doesen't send the mail at all

Both of you guys did add all field to the function right ?

$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, "", $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)

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

Posted (edited)

Both of you guys did add all field to the function right ?

$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, "", $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)oÝ÷ Ûú®¢×­«p¢é]+Þ殺+ò©àzl¬r¸©µ«­¢+Øì(ìYÉ¥±Ì(ì(ÀÌØíÍ}MµÑÁMÉÙÈôÅÕ½Ðí͵ÑÀ¹µ¥°¹½´ÅÕ½ÐììÉÍ̽Èѡ͵ÑÀµÍÉÙÈѼÕÍ´IEU%I(ÀÌØíÍ}ɽµ9µôÅÕ½Ðí ½ÐµÕÍÈÅÕ½Ðì칵ɽ´Ý¡¼Ñ¡µ¥°ÝÌ͹Ð(ÀÌØíÍ}ɽµÉÍÌôÅÕ½Ðí=Ùɱ½ÉÑݵ¥°¹½´ÅÕ½ÐììÉÍÌɽ´Ý¡ÉÑ¡µ¥°Í¡½Õ±½µ(ÀÌØíÍ}Q½ÉÍÌôÅÕ½Ðí=Ùɱ½ÉÑݵ¥°¹½´ÅÕ½ÐììÍÑ¥¹Ñ¥½¸ÉÍ̽ѡµ¥°´IEU%I(ÀÌØíÍ}MÕ©ÐôÅÕ½ÐíUÍÉ¥¹¼ÅÕ½ÐììÍÕ©Ðɽ´Ñ¡µ¥°´¸¹åÑ¡¥¹å½ÔݹХÐѼ(ÀÌØíÍ}    ½äôÅÕ½ÐìÅÕ½ÐììÑ¡µÍͽäɽ´Ñ¡µ¥°´¸±Ð±¹¬ÕÐÑ¡¸å½Ôб¹¬µ¥°(ÀÌØíÍ}ÑÑ¡¥±ÌôÅÕ½ÐìÅÕ½ÐììÑ¡¥±å½ÔݹÐѼÑÑ ´±Ù±¹¬¥¹½Ð¹(ÀÌØíÍ}
ÉÍÌôÅÕ½ÐìÅÕ½ÐììÉÍ̽ȴ±Ù±¹¬¥¹½Ð¹(ÀÌØíÍ}  ÉÍÌôÅÕ½ÐìÅÕ½ÐììÉÍ̽ȴ±Ù±¹¬¥¹½Ð¹(ÀÌØíÍ}UÍɹµôÅÕ½Ðí=Ùɱ½ÉÑݵ¥°¹½´ÅÕ½ÐììÕÍɹµ½ÈÑ¡½Õ¹ÐÕÍɽ´Ý¡ÉÑ¡µ¥°ÑÌ͹дIEU%I(ÀÌØíÍ}AÍÍݽÉôÅÕ½ÐìÐÔØààÔÅÕ½ÐììÁÍÍݽɽÈÑ¡½Õ¹ÐÕÍɽ´Ý¡ÉÑ¡µ¥°ÑÌ͹дIEU%I(ÀÌØí%AA½ÉÐôÐØÔìÁ½ÉÐÕͽÈ͹¥¹Ñ¡µ¥°(ÀÌØíÍÍ°ôÄ칱̽¥Í±ÌÍÕÉͽ­Ð±åÈ͹¥¹´ÁÕÐѼĥÕÍ¥¹¡ÑÑÁL((ì(ìMÉ¥ÁÐ(ì)±½°ÀÌØí½5åIÑlÉt)±½°ÀÌØí½5åÉɽÈô=©Ù¹Ð ÅÕ½ÐíÕѽ%йÉɽÈÅÕ½Ðì°ÅÕ½Ðí5åÉÉÕ¹ÅÕ½Ðì¤(ÀÌØíÉô}%9ÑMµÑÁ5¥±
½´ ÀÌØíÍ}MµÑÁMÉÙÈ°ÀÌØíÍ}ɽµ9µ°ÀÌØíÍ}ɽµÉÍÌ°ÀÌØíÍ}Q½ÉÍÌ°ÀÌØíÍ}MթаÀÌØíÍ}    ½ä°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíÍ}ÑÑ¡¥±Ì°ÀÌØíÍ}
ÉÍÌ°ÀÌØíÍ} ÉÍÌ°ÀÌØíÍ}UÍɹµ°ÀÌØíÍ}AÍÍݽɰÀÌØí%AA½ÉаÀÌØíÍÍ°¤()%ÉɽÈÑ¡¸(µÍ½à À°ÅÕ½ÐíÉɽÈ͹¥¹µÍÍÅÕ½Ðì°ÅÕ½ÐíÉɽȽèÅÕ½ÐìµÀìÉɽȵÀìÅÕ½ÐìÍÉ¥ÁÑ¥½¸èÅÕ½ÐìµÀìÀÌØíɤ)¹%()Õ¹}%9ÑMµÑÁ5¥±
½´ ÀÌØíÍ}MµÑÁMÉÙÈ°ÀÌØíÍ}ɽµ9µ°ÀÌØíÍ}ɽµÉÍÌ°ÀÌØíÍ}Q½ÉÍÌ°ÀÌØíÍ}MÕ©ÐôÅÕ½ÐìÅÕ½Ðì°ÀÌØíÍ}  ½äôÅÕ½ÐìÅÕ½Ðì°ÀÌØíÍ}ÑÑ¡¥±ÌôÅÕ½ÐìÅÕ½Ðì°ÀÌØíÍ}
ÉÍÌôÅÕ½ÐìÅÕ½Ðì°ÀÌØíÍ}   ÉÍÌôÅÕ½ÐìÅÕ½Ðì°ÀÌØíÍ}UÍɹµôÅÕ½ÐìÅÕ½Ðì°ÀÌØíÍ}AÍÍݽÉôÅÕ½ÐìÅÕ½Ðì°ÀÌØí%AA½ÉÐôÅÕ½ÐìÅÕ½Ðì°ÀÌØíÍÍ°ôÅÕ½ÐìÅÕ½Ðì¤(ÀÌØí½©µ¥°ô=©
ÉÑ ÅÕ½Ðí

and I get this error

C:\Documents and Settings\Evil_elf\Desktop\TEST\mailsender.au3(91,228) : ERROR: _INetSmtpMailCom() called by a previous line with 14 arg(s). Min = 13. First previous line calling this Func is 84.
Edited by Overlord
  • Developers
Posted (edited)

that would give me a error if I change my script

oops typo... should be:

$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
Edited by JdeB

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

Posted

oops typo... should be:

$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
just found that out also :-)

now it's working.

one prob still remaining now...

the mail gets send from my emailadres to my emailadres..so he doesn't gets downloaded with outlook...

  • Developers
Posted

just found that out also :-)

now it's working.

one prob still remaining now...

the mail gets send from my emailadres to my emailadres..so he doesn't gets downloaded with outlook...

Sent it TO the account you use with Outlook or am I missing something here ? :P

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

Posted

Sent it TO the account you use with Outlook or am I missing something here ? :P

that is the only gmail-account I use

probably some setting in gmail.

they show up in webmail tho...

THX JdeB

  • 1 month later...
Posted

I gots a small problem... I made a simple GUI for the SMTP script. When I run it, it goes into a loop and sends the email over and over again. Other than that it works beautifully. Can anyone see the problem ?

#include <GUIConstants.au3>
#Include<file.au3>

Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

$MyEmail = GUICreate("My eMail Program", 290, 450)
GUICtrlCreateLabel("From", 16, 16, 31, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel("Address", 16, 40, 49, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel("To", 16, 64, 19, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel("Subject", 16, 136, 47, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel("Body", 16, 184, 32, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel("Attachments", 16, 160, 74, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel("CC", 16, 88, 20, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel("BCC", 16, 112, 28, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$FromName = GUICtrlCreateInput("", 96, 16, 185, 21)
$FromAddress = GUICtrlCreateInput("", 96, 40, 185, 21)
$ToAddress = GUICtrlCreateInput("", 96, 64, 185, 21)
$CcAddress = GUICtrlCreateInput("", 96, 88, 185, 21)
$BccAddress = GUICtrlCreateInput("", 96, 112, 185, 21)
$Subject = GUICtrlCreateInput("", 96, 136, 185, 21)
$Body = GUICtrlCreateEdit("", 96, 184, 185, 113)
$AttachFiles = GUICtrlCreateInput("", 96, 160, 185, 21)
$Send = GUICtrlCreateButton("Send", 8, 416, 75, 25, 0)
$Reset = GUICtrlCreateButton("Reset", 112, 416, 75, 25, 0)
$Exit = GUICtrlCreateButton("Exit", 208, 416, 75, 25, 0)
GUICtrlCreateGroup("", 8, 304, 273, 105)
GUICtrlCreateLabel("SMTP Server", 19, 328, 68, 17)
GUICtrlCreateLabel("User ID", 19, 352, 40, 17)
GUICtrlCreateLabel("Password", 19, 376, 50, 17)
$SmtpServer = GUICtrlCreateInput("", 90, 325, 180, 21)
$Username = GUICtrlCreateInput("", 90, 349, 180, 21)
$Password = GUICtrlCreateInput("", 90, 373, 180, 21)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Send
            $Send = _INetSmtpMailCom(GUICtrlRead($SmtpServer), GUICtrlRead($FromName), GUICtrlRead($FromAddress), GUICtrlRead($ToAddress), GUICtrlRead($Subject), GUICtrlRead($Body), GUICtrlRead($AttachFiles), GUICtrlRead($CcAddress), GUICtrlRead($BccAddress), GUICtrlRead($Username), GUICtrlRead($Password))
        Case $Reset
            ;;;
        Case $Exit
            Exit
    EndSwitch
WEnd

If @error then
    msgbox(0,"Error sending message","Error code: " & @error & "  Description: " & $Send)
EndIf

Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "",$IPPort=25, $ssl=0)
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body,"<") and StringInStr($as_Body,">") Then
        $objEmail.HTMLBody = $as_Body
    Else
        $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
        Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
        For $x = 1 To $S_Files2Attach[0]
            $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
            If FileExists($S_Files2Attach[$x]) Then
                $objEmail.AddAttachment ($S_Files2Attach[$x])
            Else
                $i_Error_desciption = $i_Error_desciption & @lf & 'File not found to attach: ' & $S_Files2Attach[$x]
                SetError(1)
                return 0
            EndIf
        Next
    EndIf
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort
;Authenticated SMTP
    If $s_Username <> "" Then
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    If $Ssl Then
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    EndIf
;Update settings
    $objEmail.Configuration.Fields.Update
; Sent the Message
    $objEmail.Send
    if @error then
        SetError(2)
        return $oMyRet[1]
    EndIf
EndFunc ;==>_INetSmtpMailCom

; Com Error Handler
Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    $oMyRet[0] = $HexNumber
    $oMyRet[1] = StringStripWS($oMyError.description,3)
    ConsoleWrite("### COM Error !  Number: " & $HexNumber & "   ScriptLine: " & $oMyError.scriptline & "   Description:" & $oMyRet[1] & @LF)
    SetError(1); something to check for when this function returns
    Return
EndFunc ;==>MyErrFunc

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

  • Moderators
Posted

You don't see something wrong here?

Case $Send
            $Send = _INetSmtpMailCom(

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

  • 2 months later...
Posted (edited)

Wow!! Works perfect! Thanks! :D:)

I found this out:

GMAIL

SMTP server = smtp.gmail.com

IP Port = 465 (as you said)

SSL = 1 (as you said again)

YAHOO

SMTP server = smtp.mail.yahoo.com

IP Port = 465 (same as Gmail's)

SSL = 1 (also same as Gmail's)

I couldn't find Hotmail's SMTP server, IP Port or whether it uses SSL either. Can anyone tell us? :D:) :) :P

EDIT: Fixed typo: smtp.gmail.com not smtp.google.com

Edited by iZafiro
Posted

Wow!! Works perfect! Thanks! :D:)

I found this out:

GMAIL

SMTP server = smtp.google.com

IP Port = 465 (as you said)

SSL = 1 (as you said again)

YAHOO

SMTP server = smtp.mail.yahoo.com

IP Port = 465 (same as Gmail's)

SSL = 1 (also same as Gmail's)

I couldn't find Hotmail's SMTP server, IP Port or whether it uses SSL either. Can anyone tell us? :D:):):P

it doesnt seem to be workin with yahoo

;##################################
; Variables
;##################################
$s_SmtpServer = "smtp.mail.yahoo.com" ; address for the smtp-server to use - REQUIRED
$s_FromName = "werty_zaq@yahoo.com" ; name from who the email was sent
$s_FromAddress = "werty_zaq@yahoo.com" ;  address from where the mail should come
$s_ToAddress = "werty_zaq@yahoo.com" ; destination address of the email - REQUIRED
$s_Subject = "hello test smtpserver" ; subject from the email - can be anything you want it to be
$as_Body = "hello test" ; the messagebody from the mail - can be left blank but then you get a blank mail
$s_AttachFiles = "" ; the file you want to attach - leave blank if not needed
$s_CcAddress = "" ; address for cc - leave blank if not needed
$s_BccAddress = "" ; address for bcc - leave blank if not needed
$s_Username = "werty_zaq@yahoo.com" ; username for the account used from where the mail gets sent - REQUIRED
$s_Password = "******" ; password for the account used from where the mail gets sent - REQUIRED
$IPPort = 465 ; port used for sending the mail
$ssl = 1 ; enables/disables secure socket layer sending - put to 1 if using httpS

;##################################
; Script
;##################################
Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
If @error then
   msgbox(0,"Error sending message","Error code:" & @error & "  Description:" & $rc)
EndIf

Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "",$IPPort="", $ssl="")
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    EndFunc

it works on scite i mean it runs but it doesnt seem to send the email i wait for 15 minutes and i dont see to receive any email. do you need some kind of dll or something because it isnt sending anything.

Posted

:D:P That's weird!

http://help.yahoo.com/help/us/mail/pop/pop-28.html says it is smtp.mail.yahoo.com, 465 and SSL is on!

http://help.yahoo.com/help/uk/mail/pop/pop-28.html says it is smtp.mail.yahoo.co.uk, 587 and doesn't say whether it uses SSL or not!

I guess that different mail locations use different SMTP servers, now I'm confused!

$rc = _INetSmtpMailCom("smtp.mail.yahoo.com", "testSender", "hanonczernyhanon@yahoo.com", "craftomaniac@gmail.com", "testSubject", "testMessage", "", "", "", "hanonczernyhanon", "*********", 465, 1)oÝ÷ ÙÚ²{lyé­£
+è­êÚºÚ"µÍÌÍÜÈH ÌÍÜÈHÒS]Û]XZ[ÛÛJ    ][ÝÜÛ]ÛXZ[ÛÛI][ÝË   ][ÝÝÝÙ[][ÝË   ][ÝØÜYÛX[XXÐÛXZ[ÛÛI][ÝË   ][ÝØÜYÛX[XXÐÛXZ[ÛÛI][ÝË   ][ÝÝÝÝXXÝ  ][ÝË  ][ÝÝÝYÜØYÙI][ÝË ][ÝÉ][ÝË    ][ÝÉ][ÝË    ][ÝÉ][ÝË    ][ÝØÜYÛX[XXÉ][ÝË ][ÝÊ][ÝË

KJ

(Gmail sending) works though.

Waitaminit,

http://help.yahoo.com/mail/pop/pop-28.html

I think that means that if you want to use SSL, the port is 465. If not, the port is 587.

I'm really really really confused now.

  • 3 weeks later...
Posted

I do not get any errors now...but .....it doesen't send any mail...

I have found the GetStream methods useful for debugging, see MSDN for more properties / methods

Ensure that you have an error handler in place for event failures; esp. wrt attachments.

;assumes cdo.message object is $cdo
$email_message_text = $cdo.GetStream.ReadText

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

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