I'm hosting multiple domains in my public html folder of an ubuntu-nginx vps server. And I currently have my 'ssmtp.conf' file set up successfully to send outgoing mail(contact, registration, verification, forgot password etc using php 'mail()') from one of those domains, say, example1.com.

Would there be any way to make some modifications on the 'ssmtp.conf' file such that mail can be sent from the e-mail accounts pertaining to the other domains as well?(mail@example2.com or mail@example3.com, for instance).

Thanks in advance.

My current ssmtp.conf file looks like this:

# Config file for sSMTP sendmail
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com

# Where will the mail seem to come from?

# The full hostname

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address


You should use a SMTP library like SwiftMailer in PHP to send mails via SMTP to the mail server instead of mail() function. This way you can use arbitrary From addresses in e-mails.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.