Page 1 of 1

Requesting Help in PHP mail

Posted: Wed Jan 11, 2012 1:40 am
by tamilmani
Hi ,

My issue:- How to send the email to subdomain email address?

Example:- tamilmani@subdomain.subdomain.com

If i validate the email id , am able to see valid email message. But email is not sending to subdomain email address. Is there any solution for this issue?

Please any one give me the solution for this issue?

Thanks
Tamilmani Mohan

Re: Requesting Help in PHP mail

Posted: Wed Jan 11, 2012 3:18 am
by twinedev
What happens if you manually send e-mail to it from a regular e-mail client?

Re: Requesting Help in PHP mail

Posted: Wed Jan 11, 2012 3:29 am
by tamilmani
There is no issues in that. If i send email from email client . I am able to receive the email. But by using php , i am not able to receive the email.

Re: Requesting Help in PHP mail

Posted: Wed Jan 11, 2012 3:41 am
by twinedev
what code are you using to send it. Is the domain on same server you are trying to send it form, perhaps DNS not set up right for it on the server.

Re: Requesting Help in PHP mail

Posted: Wed Jan 11, 2012 3:48 am
by tamilmani
I am using simple PHP code.

<?php
$email ="mohantamilmani@gmail.com";
$subject = "Testing Email From Server";
$message = "This is tamilmani mohan. I am testing the mail";
mail("tamilmani@domain.sudomain.com", "Subject: $subject",$message, "From: $email" );
echo "Thank you for using our mail form";
?>

Is there any problem in above code?

If i replace the tamilmani@domain.sudomain.com to tamilmani@domain.com(ex:- tamilmani@gmail.com like) => It will work.

Re: Requesting Help in PHP mail

Posted: Wed Jan 11, 2012 5:19 am
by twinedev
Nope, don't see anything wrong with it (well functionality wise anyhow).

From there I would check to make sure the server is configured to handle the domain. (ie. you have the domain wet for web pages to go to that server, yet e-mail actually goes to another service, the server may think mail should be delivered on the server and therefore never send out).

-Greg

Re: Requesting Help in PHP mail

Posted: Wed Jan 11, 2012 5:16 pm
by Christopher
tamilmani wrote:Hi ,

My issue:- How to send the email to subdomain email address?

Example:- tamilmani@subdomain.subdomain.com
Do you have MX records for the sub-domain?

Re: Requesting Help in PHP mail

Posted: Wed Jan 11, 2012 5:33 pm
by twinedev
Christopher wrote:Do you have MX records for the sub-domain?
It was already mentioned that sending e-mail directly from e-mail client delivers properly.

I still leaning to that the subdomain was set up to be on the server running the PHP script, but the domain is actually set for mail to be handled elsewhere, and that the web server thinks it handles the email so it never leaves to make it out to the actual mail server.

-Greg

Re: Requesting Help in PHP mail

Posted: Wed Jan 11, 2012 5:37 pm
by Christopher
tamilmani may need to set the hosts file on the server with entries to let the mail system know where to send the mail.