Results 1 to 2 of 2

Thread: Formatting autoreply e-mails

  1. #1
    Join Date
    Oct 2007
    Posts
    43
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Formatting autoreply e-mails

    I have a form that sends out an autoreply, but at the moment it's just text. I'd like it to display an image at the top, and use a better font than the default. Every time I try to edit the autoreply, I end up with error messages, so any help here would be appreciated.
    Code:
    <?php 
    $to = "repairs@myemail.co.uk" ; 
    $name = $_REQUEST['name'] ; 
    $headers = "From: " . $_REQUEST['email'] . "\n" ;
    $subject = "Repair Request Form"; 
    $from = $_REQUEST['email'] ;
    
    $fields = array(); 
    $fields{"name"} = "Tenant Name"; 
    $fields{"houseNumber"} = "House Name"; 
    $fields{"address1"} = "Address Line 1"; 
    $fields{"address2"} = "Address Line 2"; 
    $fields{"address3"} = "Address Line 3"; 
    $fields{"postcode"} = "Postcode"; 
    $fields{"optone"} = "Type of Repair";
    $fields{"opttwo"} = "Problem";
    $fields{"details"} = "Details of Problem";
    $fields{"email"} = "E-mail Address";
    $fields{"dayphone"} = "Daytime Phone Number";
    $fields{"mobphone"} = "Mobile Phone Number";
    $fields{"mondayam"} = "Monday AM Repair";
    $fields{"tuesdaypm"} = "Tuesday PM Repair";
    $fields{"wednesdaypm"} = "Wednesday PM Repair";
    $fields{"thursdayam"} = "Thursday AM Repair";
    $fields{"fridayam"} = "Friday AM Repair";
    $fields{"accessarrangements"} = "Access Arrangements";
    
    
    $body = "Repair Request Information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } 
    
    $headers2 = "From: repairs@myemail.com"; 
    $subject2 = "Thank you for contacting us"; 
    $autoreply = "Thank you for using our On Line Repairs Service. The details of your request are listed below, and we will contact you within one working day to arrange your repair.\n\n"; foreach($fields as $a => $b){ $autoreply .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
    
    $send = mail($to, $subject, $body, $headers); 
    $send2 = mail($from, $subject2, $autoreply, $headers2); 
    ?>

  2. #2
    Join Date
    Aug 2007
    Location
    Ohio
    Posts
    79
    Thanks
    0
    Thanked 15 Times in 15 Posts

    Default

    For displaying an image or changing the font, you need to use HTML. For more information on HTML and Emails here's an article: How to Code HTML Email Newsletters

    If that article doesn't satisfy you, just search google for more HTML & Email articles. An email isn't as easy to write beautifully as a webpage. There's some quirks that are exclusive to e-mails involving CSS and the differences in which the e-mails are rendered. You should definitely be able to accomplish your goal though with just about any tutorial on the subject.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •