Jump to content

Sending Email


FirePhoenix

Recommended Posts

I am trying to send email from a form can someone please tell me if this is right

 

This is the Action page

 

<?php

include ("config.php") 

$fname = $_POST ["fname"];
$lname = $_POST ["lname"];
$hphone = $_POST ["hphone"];
$wphone = $_POST ["wphone"];
$address = $_POST ["address"];
$apt = $_POST ["apt"];
$city = $_POST ["city"];
$state = $_POST ["state"];
$zipcode = $_POST ["zipcode"];
$tvnumber = $_POST ["tvnumber"];
$sdtv = $_POST ["sdtv"];
$hdtv = $_POST ["sdtv"];

$to = "$email_apply";
$subject = "Dish Network Application";
$body = "First Name:",$fname/n,"Last Name:",$lname/n,"Home Phone",$hphone/n,"Work Phone:",$wphone/n,"Address:"$address/n,"Apt#:",$apt/n,"City",$city/n,"State:",$state/n,"Zip Code:",$zipcode/n,"Number of TV's:",$tvnumber/n,"SDTV:",$sdtv/n,"HDTV:",$hdtv/n;
$headers = "From: Website/n";
mail($to,$subject,$body,$headers);

?>

 

I dont have away to test it and it has to work when I upload it so any help will be much apriciated...Thank you

Link to comment
https://forums.phpfreaks.com/topic/40083-sending-email/
Share on other sites

looks ok to me, but a few things.

 

1. not sure if mail servers will see the header you have as vaild. If not, they will kick your email back as spam. (can someone else vaildate this?)

 

2. i've had problems in the past with the mail() function. Depending on your host, you mave have to send the mail() function with a -f command. I've only ever had to do this twice but the problem does exists.

 

unfortunate you don't have a place to test your scripts.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/40083-sending-email/#findComment-193924
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.