Crucial Paradigm

Call us now 1300 884 839

Member Login
Australia USA

Location: Australia

Soar with High Availability Web Hosting from $11.95/month Elastic Self-Healing Windows VPS from $54.95/month State Of The Art Infrastructure Powered By Hewlett Packard and Cisco R1 Soft CDP Backup Solution
  #1 (permalink)  
Old 05-10-2009, 11:56 PM
Junior Member
 
Join Date: Oct 2009
Location: sydney
Posts: 3
Default php email() function

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?
Reply With Quote
  #2 (permalink)  
Old 06-10-2009, 01:06 PM
Junior Member
 
Join Date: Mar 2009
Location: Chalakudy
Posts: 5
Send a message via AIM to Anusha
Default

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).
Reply With Quote
  #3 (permalink)  
Old 06-10-2009, 05:53 PM
Junior Member
 
Join Date: Oct 2009
Location: sydney
Posts: 3
Default this is the portion of the script that is suppose to send email

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();
Reply With Quote
  #4 (permalink)  
Old 06-10-2009, 06:50 PM
Junior Member
 
Join Date: Mar 2009
Location: Chalakudy
Posts: 5
Send a message via AIM to Anusha
Default

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.";
?>
---------------------------
Reply With Quote
  #5 (permalink)  
Old 06-10-2009, 07:00 PM
Junior Member
 
Join Date: Oct 2009
Location: sydney
Posts: 3
Default

yes that little script works, thank you for your assistance, i really appreciate it. now i know where to look for the problem.
Reply With Quote
  #6 (permalink)  
Old 07-10-2009, 12:42 PM
Junior Member
 
Join Date: Mar 2009
Location: Chalakudy
Posts: 5
Send a message via AIM to Anusha
Default

Please contact a good php developer and check the issue.
Reply With Quote
Reply

Tags
email, hosting, mail, php, script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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 2003-2010 © Crucial Paradigm Pty Ltd, All Rights Reserved