- This topic is empty.
-
AuthorPosts
-
January 30, 2012 at 4:58 pm #36411drizzyParticipant
Hey everyone,
I’m pretty new to this php stuff, but I’m trying to create a page that the user uploads there resume and that gets sent to my email account. Right now it says its been sent, but I don’t see it in my inbox at all. I don’t know what I’m doing wrongCan anyone look at the code and tell me what I’m doing wrong TIA
here’s the linkand my code:
$name = $_POST;
$email = $_POST;
$eligible = $_POST;
$type = $_POST;
if(isset($_POST))
{
//The form has been submitted, prep a nice thank you message
$output = "";";
"Email Sent Successfully.
";
"Thank you $name, your resume has been submitted to us.
";
"
//Set the form flag to no display (cheap way!)
$flags = 'style="display:none;"';
//Deal with the email
$to = '[email protected]';
$subject = 'Magic Bus Company Employment Application Form';
// $message = strip_tags($_POST);
$attachment = chunk_split(base64_encode(file_get_contents($_FILES)));
$filename = $_FILES;
$boundary =md5(date('r', time()));
$headers = "From: $emailrnReply-To: $to";
$headers .= "rnMIME-Version: 1.0rnContent-Type: multipart/mixed; boundary="_1_$boundary"";
$message="This is a multi-part message in MIME format.
Name: $name;rnn
Email: $email;rnn
Are you eligible to work in Canada? $eligible;rnn
What type of drivers license do you have? $type;rnn
--_1_$boundary
Content-Type: multipart/alternative; boundary="_2_$boundary"
--_2_$boundary
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
$message
--_2_$boundary--
--_1_$boundary
Content-Type: application/octet-stream; name="$filename"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
$attachment
--_1_$boundary--";
mail($to, $subject, $message, $headers);
}
?>
MailFile
February 1, 2012 at 12:03 am #95851bungleMemberI would put a condition on the mail() function and see what it returns.
I think your error/success messages should really be moved down the code so they are dependent on the mail function succeeding rather than just the posting of the form itself.
if (mail($to, $subject, $body, $headers)) {
echo(“Thank you for your submission.”);
}
else {
echo(“We’re sorry, but there was an error processing your request.”);
}This should point you as to whether your PHP system is actually sending the mail at all. I have had problems with the basic mail() function on certain ISP.
February 1, 2012 at 4:30 pm #95934drizzyParticipantThank a lot I’ll give it a try and let you know :)
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.