0

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.
root=mail@example1.com

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.example1.com:25

# Where will the mail seem to come from?
rewriteDomain=example1.com

# The full hostname
hostname=example1.com

# 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
FromLineOverride=YES

AuthUser=mail@example1.com
AuthPass=password-for-mail@example1.com
Aj334
  • 1

1 Answers1

0

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.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58