send email with attachment in php

Use the phpmailer class to add attachments

function emailWithAttachment($to, $subject, $message, $attachment) 
{

    $mail = new PHPMailer();

    $mail->AddAddress($to);

    $mail->From         = "your@email.com";
    $mail->FromName     = "Your Name";
    $mail->Subject      = $subject;
    $mail->Body         = $message;

Comments

Popular posts from this blog

Linux Shortcuts

Petra, Jordan

PayPal integration in PHP