Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Sending attachments in email

    Does anyone know how to add an attachment to an email that can be sent with the mail() function. This is what I tried:

    PHP Code:
    $to "matt@missingscore.co.uk";
    $subject "Attachment Test";
    $body "Is there an attachment?";
    $heads "From: [email]myself@missingscore.co.uk[/email]\nAttachments: myfile.gif\n";

    if(
    mail($to,$subject,$body,$heads)){

       echo 
    "Message Sent";

    } else {

       echo 
    "Error in sending";


    It sends the email, but no from or attachments appear on the email.

    Any help would be appreciated.

    P.S: Also, if anyone has any good links to file uploaders, could you post them.

    Cheers

  • #2
    New to the CF scene
    Join Date
    Jan 2003
    Location
    Amsterdam, Netherlands
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To attach files to email messages you'll have to define the message body to be a multipart mime message.

    Here are some links and examples.


  •  

    Posting Permissions

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