Sign in to follow this  
Followers 0
Vaeb

SMTP mailing problem

7 posts in this topic

Hi guys!

I'm trying to send an email with my google account.

This is the code i used (It's not the real email adress^^ but the email adresses i used exist!):

$s_SmtpServer = "smtp.gmail.com"              ; address for the smtp-server to use - REQUIRED
$s_FromName = "Name"                      ; name from who the email was sent
$s_FromAddress = "asdf@gmail.com" ;  address from where the mail should come
$s_ToAddress = "asdf@asdf.ch"   ; 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 = "asdf"                    ; username for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$s_Password = "asdf"                  ; password for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
;$IPPort = 25                              ; port used for sending the mail
$ssl = 0                                  ; enables/disables secure socket layer sending - put to 1 if using httpS
$IPPort=465                            ; GMAIL port used for sending the mail
;~ $ssl=1

Btw. I used this script as template: http://www.autoitscript.com/forum/index.ph...860&hl=smtp

And when i run the script i get this error: Error code: 2 Rc:The transport failed to connect to the server.

I hope you can help me :D

Greets Vaeb

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Change this:

$ssl = 1

also noticed you commented out the port?

Edited by BackStabbed

tolle indicium

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

woops, I missed that.

are you getting a different error when you're using ssl?

(I am not able to test the SMTP, my IP has been blacklisted... hosting bad forum scripts that send out wayyy too many emails!)

Edited by BackStabbed

tolle indicium

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

:D

I really have to thank you for your help!

No, I get exactly the same error.

When I try a script of the German forum, I get this Error: "@ERROR = 4 - Unable to create socket"

Edit: I was talking about the last script here: http://www.autoit.de/index.php?page=Thread&threadID=5947

Edited by Vaeb

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I changed ssl to 1.

It still doesn't work.

I commented the port 25 because I used the gmail port 465.

Even if I use smtp port 25 it doesn't work...

Thats doesn't sound right to me.

For GMail you need:

$IPPort=465                       ; GMAIL port used for sending the mail
$ssl=1

When you tried this then what is all info from your ComErrorHandler ?

Edited by Jos

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