Is there a way into making WordPress think that the Google mail
servers are local mail servers so that phpmail can be used properly?
Yes, you could use a firewall to create a localhost:465 socket that forwards network traffic to smtp.gmail.com:465 but what on earth for??
Is there an alternative solutions?
Yes, and you’re half way there with Google Apps.
Using Google’s Domain Manager, create a mailbox group, like [email protected], and add everybody who should be able to read these emails to that group, such as [email protected] and [email protected]
Then in your contact form’s settings:
- The sender email is [email protected]
- The sender name is the customer name
- The recipient email is [email protected], or a specific person like [email protected]
- The reply-to name and email is the customer name and email
When the receiver gets the email it has the customer name as the from, clear as day. When the receiver hits reply on this form, the email is automatically addressed to the customer who filled it out. Nothing confusing about it, and you avoid violating Gmail’s sending restrictions.
Postman is an OAuth2 SMTP plugin specifically designed for sending mail with Google Apps. You WILL have problems sending Gmail with PHPMail because of the older authentication it uses, especially with Google Apps.
Is there a better way than SMTP?
Well there’s the Gmail API but unless you’re doing transactional email or all your SMTP ports are blocked, you don’t need it.