3

I am not sure that this was the right solution in the first place but I have Postfix up and running on my Ubuntu VPS with G-Suite using

relayhost = [smtp.gmail.com]:587

Mail is delivering fine, however, all mail is being delivered as 'me@me.com' I host about different 15 websites for people and would rather not have their contact forms, user signups, etc. Showing up as an email from 'me@me.com'.

For example;

<?php
define('admin_email','client@client.com');
define('website_name','client-business-name');
define('website_url', 'http://'.$_SERVER['HTTP_HOST']);
define('EMAIL_FROM', 'noreply@'.$_SERVER['HTTP_HOST']);

Submitting these forms still, results in emails showing as being sent from 'me@me.com'

I have also tried using this snippet in an individual VirtualHost file with no luck.

php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fclient@client.com"

I found that code from these questions: Configuring php mail() per domain, Apache, virtual hosts, and default sender for sendmail

Using 'sendmail' in the command line and changing the 'From:' address doesn't seem to work either.

All I want to do is be able to have the emails that I enter in From and Reply-To used, rather than 'me@me.com'. Any insight would be greatly appreciated.

Jesse
  • 31

1 Answers1

0

I assume the me@myDomain.com is the Google account that you are using to connect to the server with. Google's servers do not let you set a random from address when using them as a relay. This would be a large security hole for them and their users. I believe that you can add the alias emails in your Google mail under:

Settings > Accounts and Import > Add another email address

Once confirmed, you can send from those addresses from the web interface. I think you should be able to send via those from your page as well.

https://support.google.com/mail/answer/22370?hl=en

Cory Knutson
  • 1,886