Wednesday 03 January 2007 4:15:46 am
I searched the previous posts, and find
$mail = new eZMail();
$mail->setReceiver( '[email protected]' );
$mail->setSender( '[email protected]' );
$mail->setSubject( 'A nice subject' );
$mail->setBody( 'Here we go' );
$mailResult = eZMailTransport::send( $mail );
but seems it doesn't work Then I go through the codes of forgotpassword, and try, found that this code works
$mail = new eZMail();
$tpl =& templateInit();
$templateResult =& $tpl->fetch( 'design:user/forgotpasswordmail.tpl' );
$mail->setSender( $emailSender );
$mail->setReceiver( $receiver );
$mail->setSubject( $subject );
$mail->setBody( $templateResult );
$mailResult = eZMailTransport::send( $mail );
maybe the body of the email must be fetched from another template? I am not sure, but when I design a new template, and fetch this template to send email it doesn't work again. Anyone can tell me how to send the customized mail with ezPublish? Thanks very much. or can introduce some article on how to send ezmail. I search the forum, but fail to find. =(
|