<?
require_once '../mailer/lib/swift_required.php';
$transport = Swift_MailTransport::newInstance();
//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance()
//Give the message a subject
->setSubject($subject)
//Set the To addresses with an associative array
->setTo(array($to => $nameto))
//->setTo(array('[email protected]' => 'Louise'))
//Set the From address with an associative array
->setFrom(array($from => $namefrom))
//A Sender: address specifies who sent the message and is set with the setSender() method of the message.
->setSender($from)
//The Return-Path: address specifies where bounce notifications should be sent and is set with the setReturnPath() method of the message.
->setReturnPath($from)
//Set Priority 1=Highest, 2=High, 3=Normal, 4=Low, 5=Lowest
->setPriority(3)
->attach(Swift_Attachment::fromPath('http://mijndomein.nl/pdf/?id=59e711d152de7bec7304a8cecaf9f0df'))
//Give it a body
->setBody($mess, 'text/html')
;
if ($mailer->send($message)){
echo "OK";
exit();
}else{
echo "NOK";
exit();
}
?>
Maar hij verstuurt nu helemaal geen email. Heeft iemand een idee hoe ik het goed krijg?