Hi,
I am trying to send an attachment in email using following code:
//Get a JMail instance
$mail = &JFactory::getMailer();
$mail->setSender(array($from, $fromname));
$mail->setSubject($subject);
$mail->setBody($body);
//Are we sending the email as HTML?
$mail->IsHTML(true);
// Recipient emailId
$mail->addRecipient($recipient);
// Attachment file
$mail->addAttachment($_FILES['intro']['tmp_name'], $_FILES['intro']['name'], $encoding, $_FILES['intro']['type']);
$mail->Send();
It works fine, but the issue is that the file is sent with temp name and no extension whatsover and not with original name and extension, however, if i access the file it opens fine.
What am i doing wrong here, please suggest!
Thanks,
Kul.