$from_name = "Prabhakar"; $subject = "Test"; $html_message = "this is test mail"; $toname = "prabhakarindia2006"; $tomailid = "prabhakarindia2006@gmail"; $sendmail->sendHtmlEMail($from_address, $from_name, $toname, $tomailid, $subject, $html_message, $html_message); */ /* Instantiate Object -------------------------------------------------------------------*/ //$mailer = new SendMail ( MSG_TXT ); $mailer = new SendMail(MSG_HTML + MSG_TXT); $mailer->setSMTP('smtp.gmail.com', '465', '*****@*****.**', 'prabhaprofit121085'); /* Set Basics, like sender, recipient (receiver), a CC, and the subject -------------------------------------------------------------------*/ $mailer->setSender('Prabhakar', '*****@*****.**'); $mailer->setReceiver('senthil', '*****@*****.**'); //$mailer->addCC('you','*****@*****.**'); $mailer->subject = 'This is a test message.'; /* Set the actual message, both HTML and TXT -------------------------------------------------------------------*/ // Load the HTML template //$template_file = fopen ( 'mail_template.html' , 'r' ); /*$template = ''; while (!feof ($template_file)) { $template .= fgets ($template_file); } fclose ($template_file); */ $msg = <<<MSG this is text test mail in php MSG; /*$mailer->reparseMail ( $template , array (
<?php //加载邮件类 require_once "libs/LogUtil.class.php"; require_once "libs/SendMail.class.php"; $name = $_POST["name"]; $address = $_POST["address"]; $mess = $_POST["mess"]; $content = "用户:{$name}<br/>邮箱地址:{$address}<br/>消息内容:{$mess}"; Log::i("********************开始发送"); $mail = new SendMail(); Log::i("*********************开始设置参数"); $mail->setServer("smtp.126.com", "*****@*****.**", "whlqyl040406081"); $mail->setFrom("*****@*****.**"); $mail->setReceiver("*****@*****.**"); $mail->setMailInfo("个人主页", "网站邮件", $content, ""); Log::i("*********************设置参数完成"); $result = $mail->startSendMail(); Log::i("**********************发送结果{$result}" . $mail->error()); echo "{'result':'{$result}'}";