I’m trying to format the data sent to me better in the email.
Current code that works fine without the formatting is:
[php]<?php
$to = ‘[email protected]’ ;
$from = $_REQUEST[‘email’] ;
$name = $_REQUEST[‘CharacterName’] ;
$headers = “From: $from”;
$subject = “New Insanity Guild Application”;
$fields = array();
$fields{“CharacterName”} = “Character Name”;
$fields{“ArmoryLink”} = “Battle.net link”;
$fields{“CharacterClass”} = “Character Class”;
$fields{“CurrentSpec”} = “Current Spec”;
$fields{“CurrentServer”} = “Current Server”;
$fields{“CurrentGuild”} = “Current Guild Name”;
$fields{“ReasonForLeaving”} = “Reason for leaving current guild”;
$fields{“GuildHistory”} = “List guild history”;
$fields{“Reason”} = “Reason for applying to Insanity”;
$fields{“LookGuild”} = “What you look for in a guild”;
$fields{“WwsReportLinks”} = “List WWS/WOL report links”;
$fields{“AddNotes”} = “Additional Notes”;
$body = “We have received the following application:\n\n”; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$headers2 = “From: [email protected]”;
$subject2 = “Thank you for applying to Insanity of Black Dragonflight”;
$autoreply = “Thank you for contacting us. Somebody will get back to you as soon as possible, usualy within 48 hours. If you have any more questions, please consult our website at www.insanity-guild.net”;
if($from == ‘’) {print “You have not entered an email, please go back and try again”;}
else {
if($name == ‘’) {print “You have not entered a name, please go back and try again”;}
else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
{header( “Location: http://www.insanity-guild.net/thankyou.html” );}
else
{print “We encountered an error sending your mail, please notify [email protected]”; }
}
}
?> [/php]
Just formatting it would work by I would ultimately like to receive it in html.
Have been trying to get it done on my own but when I add the headers I come back with an error. So I thought I’d let you guys help from scratch.
Thanks in advance.