SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm looking for information on creating complex email using PHP. My site currently uses the mail() function to send email but I want to send complex email using HTML for formating/images and PHP/MySQL to personalize the message. The PHP Manual talks about complex email but the doco is brief. Any info, links to tutorials, etc would be appreciated.

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For sending MIME message (with attachments), use the MIME Mail class for PHP:

    http://www.heyes-computing.net/scripts/

    And to customize the content, it's like generating dynamic HTML pages and send it using MIME Mail class.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've have downloaded the HTML Mime Mail Class from Richard Heyes. I put example.php in a php page on my site but I don't get the email. Below is the code I included in the page. I'm using PHP4, MySQL and Apache for win32. php.ini is configured for includes and mail. My SMTP mail server is mail.idirect.ca and I use http://127.0.0.1/ to serve my pages on my local machine. My site is in development and not hosted. Can anyone tell me what I'm doing wrong? Also, how do I set things up for hotmail as hotmail uses a HTTP server, not SMTP?

    error_reporting(63);
    include('class.html.mime.mail.inc');

    $filename = 'images/background.gif';
    $backgrnd = fread($fp = fopen($filename, 'rb'),filesize
    ($filename));
    fclose($fp);
    $mail = new html_mime_mail('X-Mailer: Html Mime Mail Class');

    $text = 'Success.';
    $html = '<HTML><BODY BACKGROUND="images/background.gif">'."\r\n".'<FONT FACE="Verdana, Arial" COLOR="#FF0000">'."\r\n".'&nbsp;&nbsp;&nbsp;&nbsp;Success...</FONT>'."\r\n".'<P></BODY></HTML>';

    $mail->add_html_image
    ($backgrnd, 'images/background.gif', 'image/gif');
    $mail->add_html($html, $text);

    $mail->set_charset('iso-8859-1', TRUE);

    $mail->build_message();

    include('class.smtp.inc');
    $smtp = new smtp_class;

    $smtp->host_name= 'mail.idirect.ca'; $smtp->localhost= '127.0.0.1'; $from = 'brs@idirect.ca';
    $to = array('$emailarray[index]'); $headers = array('To: $namearray[$index] <$emailarray[$index]>');

    $mail->smtp_send('smtp', $from, $to, 'Welcome', $headers);

  4. #4
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since this post is loosing priority, I'm resending the post with hopes to get a reply. Sorry if this irritates anyone.


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
  •