Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to get attachments to emails php

use PHPMailerPHPMailerPHPMailer;
use PHPMailerPHPMailerException;

$email = new PHPMailer();
$email->SetFrom('you@example.com', 'Your Name'); //Name is optional
$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();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #attachments #emails #php
ADD COMMENT
Topic
Name
1+1 =