Magento how to mail in magento php script
Magento how to mail in magento php script ?
$mail = Mage::getModel( ‘core/email’ );
$mail->setToName( $to_name );
$mail->setToEmail( $to_email );
$mail->setBody( $email_content );
$mail->setSubject( $email_subject );
$mail->setType( ‘html’ );
if ( Mage::getStoreConfig( ‘jbmarketplace/jbmarketplace/email_from_name’ ) != ” )
$mail->setFromName( Mage::getStoreConfig( ‘jbmarketplace/jbmarketplace/email_from_name’ ) );
if ( Mage::getStoreConfig( ‘jbmarketplace/jbmarketplace/email_from’ ) != ” )
$mail->setFromEmail( Mage::getStoreConfig( ‘jbmarketplace/jbmarketplace/email_from’ ) );
$mail->send();
}
catch( Exception $e ) {}
}
Leave a Reply
Want to join the discussion?Feel free to contribute!