Sending an SMTP Mail using Curl in a Batch file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
X3nion
Posts: 9
Joined: 15 Apr 2020 10:02

Sending an SMTP Mail using Curl in a Batch file

#1 Post by X3nion » 18 Apr 2020 16:05

Hey there!

I'd like to send an email using curl in a batch file.
I tried the following lines:

curl --url 'smtps://securesmtp.t-online.de:587' --ssl-reqd --cacert cacert.pem --mail-from 'user@t-online.de' --mail-rcpt 'user@t-online.de' --user 'user@t-online.de:password'

And this works out well!

Now I'd like to make the connection more secure. In the end, it says: " Connection #0 to host securesmtp.t-online.de left intact"
How could this be closed?

And furthermore, how could I kind of protect the password I type in?

Could someone help me with that?

I'd be grateful for every help!

Kind regards,
X3nion

scavenger
Posts: 18
Joined: 23 May 2015 13:51
Contact:

Re: Sending an SMTP Mail using Curl in a Batch file

#2 Post by scavenger » 22 Apr 2020 13:57

1. if you want to use a password on a command line that is not possible.
please give more context first

2. more secure than ssl? i don't understand. what is more secure than an SSL tunnel?

X3nion
Posts: 9
Joined: 15 Apr 2020 10:02

Re: Sending an SMTP Mail using Curl in a Batch file

#3 Post by X3nion » 24 Apr 2020 05:25

Hey scavenger and thanks for your reply!

Well the curl-command as posted in the first post works very well and sends a mail to me. And there I provided username+password in the command line.

However, the password is sent without being obscured or decrypted somehow.

Is there any possibility to make the transmission more secure?

Kind regards,
X3nion

Post Reply