search
top

Email with attachment in Magento

I had a specific requirement to generate a CSV file and send the same as an attachment in a mail, without saving it at any physical location. I am listing here the way to do it. <?php $csv = ''; $_columns = array( 'N', 'SKU', 'Name' ); $data = array(); // prepare CSV header… foreach ($_columns as $column) { $data[] = '"'.$column.'"'; } $csv .= implode(',', $data)."\n"; $productData...
read more

Send email from components

While working in Joomla CMS, many times need arises to send mail from the components. Joomla has a class defined for doing this. I am listing here the method for sending mail. <?php $admin_email = ‘test@test.com’; $subject = ‘Mail Testing’; $Body = “Sending mail from component”; $sender_email = “sender@sender.com”; $sender_name = “Sender Name”; $mail = &JFactory::getMailer();...
read more

top