mail() function does not work - actually i cant tell

A

Anonymous

Guest
Hi shg2001,
i modified your code and send you back, use this. Most of the servers are not supporting the header to rename the from address. So, i simply disabled that line. I tested in my server not in local host. Code as below,
Code:
<?php
if ((!isset($process_errors)) && ($action == "process")) {
$to = 'dsporn@ibenefitsdirect.com' . ', '; // note the comma
$to .= 'vijana2004@yahoo.co.in';
$subject = 'New submission data';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
//$headers .= 'from:ibenefitsdirect.com<forms@ibenefitsdirect.com>' . "\r\n";
$message = "
A customer send at inquiry today at: $timestamp
The inquiry came from IP address: $ip_addr
The inquiry was direct to: $subject
The inquiry contain the following information:

Required Fields
Email Address: $email_addr
First Name: $fname
Last Name: $lname
Home Phone: $home_phone
Work Phone: $work_phone
Cell Phone: $cell_phone
Primary Contact: $pri_contact
Best Time to Call: $call_time

Address==>
Address 1: $addr1
Address 2: $addr2
City: $city
State: $state
Zip/Postal Code: $zip
Has Insurance: $has_insurance";

mail($to, $subject, $message, $headers);
}
?>

Try it and send me feedback.
 
from the server you are using the PHP script from, do this..

go to a shell or if you're using (Blah) Windows, a command prompt.. (If you're using Windows Vista or Windows 7, you'll need to install Telnet)

telnet <your mail server ip address> 25

if it returns a header, you have a direct connection, not blocked by firewalls or access-lists.


Next, your form values are all empty.
Unless you are doing some extract($_REQUEST) I don't see where you're values can be populated, thus if you are sending any email, your information would be blank anyway.

P.S. extract($_REQUEST) is bad. very very bad.
Always better to create an array of the variable names, parse the $_REQUEST through a for-loop and assign them by checks.


A mail server will not(shall not, should not) send mail from a blank sender.
 
Back
Top