Im really stuck with this swiftmail method of sending email with attachment. My emails never seem to be delivered. I send the email and it just ruturns without any errors but when I check my mail nothing is delivered. Please help! I troubleshooted everything and everything works except for the attach() function. I dont know whats wrong. Heres my code.
<?php
//I didnt add my validations and variables above.....
require_once('./swiftmailer/lib/swift_required.php');
$transport = Swift_SmtpTransport::newInstance('smtp.host.com', 25)
->setUsername('user')
->setPassword('pass');
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance()
->setSubject('Online Form')
->setFrom(array($from_email => $full_name))
->setTo(array('email@mail.com' => 'Jack'))
->setBody(''.$message_temp.'')
->attach(Swift_Attachment::fromPath($_FILES['attachment']['tmp_name'])
->setFilename($_FILES['attachment']['name']));
$result = $mailer->send($message);
?>