How do I send email with sendmail to external hosts?
- by Jake
If I wanted to send an email to a user on the same linux machine, I can run:
echo -e "Subject: Foo\n\nBar\n" | sendmail -v jacob
But if I run:
echo -e "Subject: Foo\n\nBar\n" | sendmail -v [email protected]
It will give me the error:
050 >>> MAIL From:<jacob@mu> SIZE=321
050 550 5.1.8 Cannot resolve your domain {mx-us011}
If my machine has access to the internet but is behind a router and has no domain associated with it, can I use sendmail to send mail to this address?
Do I need to connect through an SMTP server?
Can I do that with sendmail?
If I use sendmail's -f option and put my gmail account there it will work. Can (or should I) I use my IP address?
echo -e "Subject: Foo\n\nBar\n" | sendmail -v -f [email protected] [email protected]
I'm a bit lost on how all this comes together in sending mail from the command line.