News:

Support the VirtueMart project and become a member

Main Menu

administration e-mail is not working correctly

Started by lagunary, February 02, 2013, 12:34:49 PM

Previous topic - Next topic

lagunary

Dear All,

I've made some modification with confirmation e-mail. It's made an XML file, and I try to attach with the admin email.
I've tried to attach an alternative way, there are the attach and makexml template in mail_html.php, and the attach looks like this:
<?php
$mailer = JFactory::getMailer();
$mail_subject = $this->orderDetails['details']['BT']->order_number;
$mail_body = "Rendelés érkezett";
$mail_body = html_entity_decode( $mail_body );
$config = JFactory::getConfig();
$sender = array(
    $config->getValue( 'config.mailfrom' ),
    $config->getValue( 'config.fromname' ) );
$mailer->setSender($sender);
$recipient = $sender[0];
$mailer->addRecipient($recipient);
$mailer->setSubject($mail_subject);
$mailer->setBody($mail_body);
$path = 'XXXXXXXXX';
$file = $this->orderDetails['details']['BT']->order_number.'.xml';
$mailer->addAttachment($path.$file);
$mailer->Send();
?>
I've use my path in correct form.

My problem is that if this $mailer->Send(); and in the shopfunction.php $mailer->Send(); I don't know why but send the xml twice.
If I comment this send function, the attached file will not be sent.

Please try to figure out, what could be the problem.

Thanks
Viktor