Jump to content

Sending emails via command line: Difference between revisions

Line 104: Line 104:
===Method 2===
===Method 2===
----
----
This next method is superior when sending longer messages. Instead of using the echo command, we'll store our email header and body information into a text file. Just as in the example above, lets send an email from the hypothetical address '''[email protected]''' to '''[email protected]''' using Gmail's SMTP settings, but without using echo:
This next method is superior when sending longer messages. Instead of using the echo command, we'll store our email header and body information into a text file. Just as in the example above, let's send an email from the hypothetical address '''[email protected]''' to '''[email protected]''' using Gmail's SMTP settings, but without using echo:


  :~# sendmail -v -H "exec openssl s_client -quiet -connect smtp.gmail.com:587 -tls1 -starttls smtp" <span style=color:red>'''</tmp/mail.txt'''</span> -f [email protected] -au"[email protected]" -ap"pass"[email protected]
  :~# sendmail -v -H "exec openssl s_client -quiet -connect smtp.gmail.com:587 -tls1 -starttls smtp" <span style=color:red>'''</tmp/mail.txt'''</span> -f [email protected] -au"[email protected]" -ap"pass"[email protected]
Anonymous user