Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26-08-2009
Member
 
Join Date: Jun 2009
Posts: 49
Getting blank emails using PHP mail ()

I have created a contact form in php. When I click on the send button, I am getting blank emails. The form works properly during form fill-up but fails at submission time. I tested the form on various computers but the result is same. Can you explain me why am I getting blank emails? I am using PHP mail ().
Reply With Quote
  #2  
Old 26-08-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Getting blank emails using PHP mail ()

How did you defined mail() function? It seems to be declaration flaws. The correct syntax for defining mail() function is as below:

PHP Code:
mail($ destination_address@mail.com, $ subject, $ message, $ Fromsenders_address@mail.com); 
Reply With Quote
  #3  
Old 26-08-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Getting blank emails using PHP mail ()

Change your mail () as follows:

PHP Code:
<?php
$to 
'fellah@example.com';
$subject 'test';
$message "This is the test message";
$headers 'From: techarena@example.com' "\r\n" .
    
'Reply-To: techarena@example.com' "\r\n" .
    
'X-Mailer: PHP/' phpversion();
mail($to$subject$message$headers);
?>
Reply With Quote
  #4  
Old 26-08-2009
Member
 
Join Date: Nov 2008
Posts: 1,192
Re: Getting blank emails using PHP mail ()

This is the first time I have seen this kind of problem. To be frank I really need your code in order to rectify your problem. I don't think this is just the problem with main() syntax. There is definitely something else which resulted you to have blank mails. Have you checked your code once to be sure if there is something missing. Did you received any error or warning message? Often people make mistakes while ending the statements. Check and reconfirm if this isn't causing the problem.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Getting blank emails using PHP mail ()"
Thread Thread Starter Forum Replies Last Post
Opera mail keeps sending Emails Prabhukumar Portable Devices 6 09-11-2011 08:08 PM
Blank emails in Outlook caused by Avast Rucika Networking & Security 8 31-10-2011 04:07 PM
How can I fix blank emails on iPhone iOS 4 Micmac Portable Devices 4 30-08-2010 12:51 PM
Cannot delete emails in Windows Mail rasena Windows Vista Mail 2 11-08-2010 06:23 AM


All times are GMT +5.5. The time now is 05:10 PM.