I'm using MailCatcher, which listens on port 1025 instead of port 25. I'd like to send an email using mailx
, e.g.,
mailx -s 'Hello World!' foo@example.com
How do I get mailx to use the mailcatcher port 1025? The man page is pretty daunting.
I'm using MailCatcher, which listens on port 1025 instead of port 25. I'd like to send an email using mailx
, e.g.,
mailx -s 'Hello World!' foo@example.com
How do I get mailx to use the mailcatcher port 1025? The man page is pretty daunting.
mailx has a system-wide configuration /etc/mail.rc
.
You can edit the file to add or update the following to set the SMTP server address and port.
set smtp=your_mail_server_name_or_IP:port
If your mailx command is being run from the same machine as MailCatcher then you can enter:
set smtp=localhost:1025
Hope this helps!