Requesting Help in PHP mail
Moderator: General Moderators
Requesting Help in PHP mail
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
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
What happens if you manually send e-mail to it from a regular e-mail client?
Re: Requesting Help in PHP mail
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
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
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.
<?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
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
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
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Requesting Help in PHP mail
Do you have MX records for the sub-domain?tamilmani wrote:Hi ,
My issue:- How to send the email to subdomain email address?
Example:- tamilmani@subdomain.subdomain.com
(#10850)
Re: Requesting Help in PHP mail
It was already mentioned that sending e-mail directly from e-mail client delivers properly.Christopher wrote:Do you have MX records for the sub-domain?
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
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Requesting Help in PHP mail
tamilmani may need to set the hosts file on the server with entries to let the mail system know where to send the mail.
(#10850)