I need to send an email with an attachment with the standard php mail function. I can't use classes like phpmailer. PHP verison 5.3.
This is working so far.
mail($to,$subject,$content,$headers);
Can you help me out?
I need to send an email with an attachment with the standard php mail function. I can't use classes like phpmailer. PHP verison 5.3.
This is working so far.
mail($to,$subject,$content,$headers);
Can you help me out?
Use below code for send mail with attachment
$email = new PHPMailer();
$email->From = 'you@example.com';
$email->FromName = 'Your Name';
$email->Subject = 'Message Subject';
$email->Body = $bodytext;
$email->AddAddress( 'destinationaddress@example.com' );
$file_to_attach = 'PATH_OF_YOUR_FILE_HERE';
$email->AddAttachment( $file_to_attach , 'NameOfFile.pdf' );
return $email->Send();