You have specified answer in the question itself. You can do that using
define(`SMART_HOST', `smtp.your.provider')dnl
Are you facing any problem using this. After editing /etc/mail/sendmail.mc you should go to directory /etc/mail. Type make and then restart sendmail service for changes to take effect. Then send a test mail and see message headers (Received:) to see if configuration worked.
Do yourself a huge favour and replace sendmail with either a modern mta like postfix or something more lightweight like ssmtp. I'm amzed that sendmail is still used voluntarily
You have specified answer in the question itself. You can do that using
Are you facing any problem using this. After editing
/etc/mail/sendmail.mc
you should go to directory/etc/mail
. Typemake
and then restartsendmail
service for changes to take effect. Then send a test mail and see message headers (Received:) to see if configuration worked.If you aren't doing anything more fancy with the cumbersome beast that is Sendmail then you could consider using SSMTP instead.
It's a relay-only MTA which is lightweight and couldn't be simpler to configure.
Do yourself a huge favour and replace sendmail with either a modern mta like postfix or something more lightweight like ssmtp. I'm amzed that sendmail is still used voluntarily
Nullmailer, IMHO, is even easier to configure. Here is a quick howto:
Edit this file:
Edit another file:
[mysmtpserver.com] smtp --auth-login --user=[username] --pass=[password]
Source