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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.