-2

Hi I am trying to create my contact form and link it up with my Gmail account which I have. I have been trying to use the normal simple way by creating a HTML form and PHP file so that I can use the mail() function to send the email but this does not seem to work at all.

I want to create a contact form which links to my Gmail account and works when I host it on my server which is godaddy. This is driving me insane for the past 4 hours!!

Rahid
  • 17
  • 9
  • 1
    So what's your question/problem? Or does the concept itself drive you insane? – John Conde Aug 14 '14 at 15:46
  • So you want to basically write a contact form, that will email you the contents. And your email address is a Gmail one? – Lee Aug 14 '14 at 15:47
  • 1
    @Rahid You do **NOT** mention anything about the form not working when you press submit. In fact, you offer us nothing useful to help you. This is a poor question. Additionally, your comment is rude and unwelcome here. [You should read this before you post your next one.](http://s.tk/onhold). – John Conde Aug 14 '14 at 15:49
  • @Rahid it is unclear what you are asking. please see my answer below...I can't say it is the true one because I can't understand your question properly..If you want to get some true answers here, edit your existing question in such manner that can be understood clearly...Also, post whatever you have tried so far. – Krupal Shah Aug 14 '14 at 16:03

1 Answers1

0

Gmail is not the only mail service that will ignore sendmail emails.

If you're using 3rd-party hosting, you should find out the host name (e.g. "myhost.com") and use that in your From: header. Then use the correct email address in the "Reply-To" header instead.

Just for example:

$mailheader .= "Reply-To: Some One <someone@mydomain.com>\r\n"; 
$mailheader .= "Return-Path: Some One <someone@mydomain.com>\r\n"; 
$mailheader .= "From: Some One <mydomain@myhost.com>\r\n"; 
$mailheader .= "Organization: My Organization\r\n"; 
$mailheader .= "Content-Type: text/plain\r\n"; 

To increase deliver ability, you should use SMTP to send a mail via an actual email account.

Krupal Shah
  • 8,949
  • 11
  • 57
  • 93