SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Now where to find phpmailer or swiftmailer....

    The problem is simple. .

    Attach a file.
    And send an email.

    PLz plzplzplzplzzzzzzzzzzzzzzzz
    Last edited by MohsinAli; Aug 4, 2006 at 00:16. Reason: Actually I've found its solution and now want to proceed for something else...
    [COLOR=SlateGray]
    Web Developer @ VeriQual

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    phpmailer or swiftmailer makes it easy.

  3. #3
    PHP Brainiac dg_den_golotyuk's Avatar
    Join Date
    Jul 2006
    Location
    Kiev, Ukraine
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to use simple mail() function - then you must operate with headers. If you want to attach a file - must read it and save in the message, but use a special headers for that file:

    PHP Code:
    <?php
    $path 
    "C:/file.dat";
    $fp fopen($path'r');
    while ( 
    $data fread($fp8192) )
    {
           
    $content .= $data;
    }

    $content_encode chunk_split(base64_encode($content));
    $message .= $content_encode "\n";
    $boundary '-----=' md5uniqid rand() ) );
    $message .= "--" $boundary "\n";
    $headers  "From: \"Me\"<me@here.com>\n";
    $headers .= "MIME-Version: 1.0\n";
    $headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"";
    mail('myAddress@hotmail.com''Email with attachment from PHP'$message$headers);
    ?>

    This was taken from php.net manual and comments
    DG [Den Golotyuk], Lead Developer
    Chestnut Software
    Avoid web outsourcing scams!
    Click here
    for a free downloadable report

  4. #4
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    where to find phpmailer or swiftmailer....

    Quote Originally Posted by clamcrusher
    phpmailer or swiftmailer makes it easy.

    Where to find them and use.
    [COLOR=SlateGray]
    Web Developer @ VeriQual

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MohsinAli
    Where to find them and use.
    maybe ?


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
  •