Results 1 to 2 of 2

Thread: php mailer script

  1. #1
    Join Date
    Nov 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question php mailer script

    hey guys, can some help me? i have this script called php mailer, and its great. heres what it looks like

    php_mailer.php file:
    PHP Code:
    <?php
    function html_mail ($to$subject$html_message$from_address$from_display_name=''){
        
    $email_from_addr $from_address// actual email address of the sender
        
    $email_from_name $from_display_name// display name, if any, that the sender wishes to use
        
    $email_subject =  $subject// The Subject of the email 
        
    $email_txt $html_message// Message that the email has in it 
        
    $email_to $to// Who the email is to
        
    $headers $email_from_name == '' "From: ".$email_from_addr "From: ".$email_from_name." <".$email_from_addr.">";
        
    $semi_rand md5(time()); 
        
    $mime_boundary "==Multipart_Boundary_x{$semi_rand}x"
        
    $headers .= "\nMIME-Version: 1.0\n" 
                
    "Content-Type: multipart/mixed;\n" 
                
    " boundary=\"{$mime_boundary}\""
        
    $email_message .= "This is a multi-part message in MIME format.\n\n" 
                    
    "--{$mime_boundary}\n" 
                    
    "Content-Type:text/html; charset=\"iso-8859-1\"\n" 
                    
    "Content-Transfer-Encoding: 7bit\n\n" 
                    
    $email_txt 
                    
    "\n\n\n<span style=\"font-family: verdana, ariel, sans-serif; font-size: 11px\"><a href=\"http://4wordsystems.com\">Free code from 4word systems</a></span>";
    //                "<html><body><img src='" . $fileurl . "'><BR>" . $email_txt . "</body></html>\n\n"; 
        
    $ok = @mail($email_to$email_subject$email_message$headers); 
        if(! 
    $ok) { 
            die(
    "Sorry but the email could not be sent. Please go back and try again!"); 
        } 
    }
    ?>
    so thats the main file, and then there is a file called mailer_form.php

    PHP Code:
    <?
    include "html_mailer.php";
    ?>
    <html>
    <head>
    <title>PHP Mailer</title>
    </head>
    <body><center>
    <br><h2><b>PHP MAILER v1.0</b</h2><br>
    <form action="html_mailer.php" method="POST" enctype="MULTIPART/FORM-DATA">
    <table border=1 width="75%" cellpadding="1" cellspacing="0">
    <tr><td align=right>Your Friend's E-mail Address</td><td><input name="to" size="45" value=""></td></tr>
    <tr><td align=right>Your Name:</td><td><input name="from_name" size="45"></td></tr>
    <tr><td align=right>Your E-mail Address:</td><td><input name="from" size="45"></td></tr>
    </table><input type="submit" value="SEND MAIL"><input type="reset" value="CLEAR">
    </form>
    <br>
    <hr><font size="1" color="#777777">
    </body>
    </html>
    how can i get mailer_form.php where users can enter in there name (FROM), there e-mail address (FROM), there friends name (SEND TO), and there friends email address (SEND TO). so what ever html message is in the php_mailer.php will send to the friends inputed email address field,
    can any one help?
    thanks.

    -peej

  2. #2
    Join Date
    Nov 2006
    Location
    Hürth
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default interesting site

    A very interesting site, I think. The Idea of Technometry was new for me but worth to be read and thought abot it (although I'm not a native english-speaker and have some difficulties whith this language)

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
  •