|
|||
|
hi, im trying to run this function on a shared hosting.
script thinks that the email was sent but then nothing arrives at the email account. is there anything i have to enable in the cpanel? does anyone have experience with this type of problem? |
|
|||
|
Hi,
Can you please paste the php mail script that you are using? Please make sure that you are using the correct configuration details. Like, if you are using the same server as the mail server, use localhost as the mail server(instead of mail.domainname). |
|
|||
|
Code:
$to = 'myaddress@gmail.com';
$subject = 'Website Change Reqest';
$headers = "From: " . $cleanedFrom . "\r\n";
$headers .= "Reply-To: ". strip_tags($_POST['req-email']) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
if (mail($to, $subject, $message, $headers)) {
echo 'Your message has been sent.';
} else {
echo 'There was a problem sending the email.';
}
// DON'T BOTHER CONTINUING TO THE HTML...
die();
|
|
|||
|
Please check with the help of a simple test php script to send mail. If that is working, there is some problem with the code and check it.
One simple test script is given below. --------------------------- <?php $to = "someone@example.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "someonelse@example.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> --------------------------- |
![]() |
| Tags |
| email, hosting, mail, php, script |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
All times are GMT +11. The time now is 05:43 PM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2









Linear Mode
