0

would you know what is the IP address of the SMTP GMAIL (It allows you to send mail from a batch windows)

@echo off

set repertoire="C:\Mon repertoire\"
set [email protected]
set [email protected]
set copie=-cc [email protected]
set subj=-s "Titre de mon message"
set server=-server smtp.domaine.com
set x=-x "X-Header-Test: header supplémentaire optionnel inséré dans le mail"
set debug=-debug -log envois-mails.log -timestamp

FOR /F "tokens=*" %%i IN ('DIR /B /O-D %repertoire%*.log') DO set fichier="%repertoire:"=%%%i" && GOTO DONE || GOTO DONE
: DONE

blat %fichier% -mime -8bitmime -to %eMail% %copie% -f %emetteur% %subj% %server% %debug% %x%

thank you in advance

1 Answer 1

0

Rather than IP address you should actually use domain address since IP address might easily change.

For smtp server in google domain use smtp.gmail.com and port 587.

Some details on the topic can be found here.


On a side note - IMHO it's really a shameful thing to do to come to superuser.com and ask question before reviewing at least top 3 pages on a google search for gmail smtp settings which I'm 100% sure you did not do.

6
  • I tried it but I still have a problem ! here is the error: 2014.07.21 11:15:16 (Mon): The SMTP server does not like the sender name. Have you set your mail address correctly? Jul 21, 2014 at 9:18
  • please include the error in your original question. Although i do not see an option in your batch code to enable TLS authentication which might be the cause of an error you are receiving.
    – mnmnc
    Jul 21, 2014 at 9:19
  • @user2480100 Heres is the problem description the same as yours: groups.yahoo.com/neo/groups/blat/conversations/topics/7729 and the solution: "You need stunnel to provide the Secure Sockets Layer (SSL) as required by GMail. See the line above that says STARTTLS, and the next line that identifies ports 465 or 587. Blat does not support SSL itself, but it can send messages through another program which does provide SSL."
    – mnmnc
    Jul 21, 2014 at 9:23
  • So what do I need to change or add to my script? Jul 21, 2014 at 9:35
  • 1
    Nothing. Your script is complete as it is capable of sending emails via SMTP. It's just not able to send emails via Gmail SMTP server as it does not include SSL/TLS authentication. You need some other program that will handle secure connection after which this script of yours would be able to send emails through SSL tunnel that will be established. That's is completely different question.
    – mnmnc
    Jul 21, 2014 at 9:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .