I have developed a website hosted on 1and1 which has a webform for submitting contact information.
The client wants to retain his current GMAIL address for receiving the emails.
Can I use his email address in the php mailer settings? My understanding is that 1and1 will reject the website generated emails unless the from address is the same as his domain name. I am new to this...
You can add a
FROM: [email protected]
header in the PHPmail()
function, which will show up on the recipient mail client as being from someone at[email protected]
. Some mail servers may tag it as spam if they identify the email as not coming from a mail server which is authorised to send emails for that domain.Additionally, 1and1 may drop emails from being sent from domains other than those hosted by them/authorised by them. It is probably worth contacting them to clarify this.
Something like the following should do what you want, provided there are no blocks etc. But as Constantine says above, it may go into a spam folder etc.
You could always look into setting a
Reply-To:
header (similar to theFrom:
above if you need to send it from a domain hosted by 1and1.