検索条件
全22件
(1/5ページ)
$mail -> text( ビューの内容 );として渡してやれば、それで終了です。
$mail = new Qdmail(); $mail -> text( 'ここに内容をいれます' ); $mail -> from( 'from@example.com' , '配信元日本語名' ); $mail -> to( 'address@example.com' , '宛先日本語名' ); $mail -> subject( 'タイトルも日本語で' ); $mail ->send();もし、ビューの内容を送信したいのであれば、
$mail ->send( $this->render() );でOKです。
class Mailtest_Action_Index extends Mailtest_ActionClass
{
function perform()
{
include_once('qdmail.php');
$regist_user='田中';
$ethna_mail =& new Ethna_MailSender($this->backend);
$content = $ethna_mail->send(null,
'testmail.tpl',
array('username' => $regist_user));
qd_send_mail('html',
'address@mail456.com',
'えすなテスト',
$content,
'from@exaple.com',
null
);
return;
}
}
include_once('qdmail.php');
$regist_user='田中';
$ethna_mail =& new Ethna_MailSender($this->backend);
$content = $ethna_mail->send(null,
'testmail.tpl',
array('username' => $regist_user));
$mail -> html($content);
$mail -> to( 'address@example,com' );
$mail -> from( 'from@example,com' );
$mail -> subject( 'えすなテスト' );
return;
要は$contentにメールの内容を入れてしまえば、後は普通のQdmailの使い方と同じです。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp" />
<link rel="stylesheet" href="{$config.url}css/ethna.css" type="text/css" />
</head>
<body>
<div id="header">
<h1>Mailtest</h1>
</div>
<div id="main">
<h2>メールテスト</h2>
<p>こんにちは、{$username}さん</p>
</div>
<div id="footer">
Powered By <a href="http://ethna.jp">Ethna</a>-{$smarty.const.ETHNA_VERSION}.
</div>
</body>
</html>
mb_detect_encoding() が正しく動作しないバグ。
文字化けの原因になります。
回避方法: 文字コードをUTF-8かEUC-JPに統一し、unitedCharset()メソッドをお使いください。