Phpmailerからメールを送信できます。これがコードです。ルートディレクトリにPhpmailerファイルを追加するだけです。
<?php
if (!isset($_SESSION)) {
session_start();
}
include_once('class.phpmailer.php');
$first = @$_POST['name'];
$last = @$_POST['last'];
$email = @$_POST['email'];
ob_start();
?>
<table width="361" align="center" style="border-bottom:solid #848484 thin; border-left:solid #848484 thin; border-top:solid #848484 thin; border-right:solid #848484 thin;">
<tr>
<td colspan="2" align="center" style="border-bottom:solid #848484 thin; border-left:solid #848484 thin; border-top:solid #84848``4 thin; border-right:solid #848484 thin;">Contact Form</td>
</tr>
<tr>
<td width="21" style="border-bottom:solid #848484 thin; border-left:solid #848484 thin; border-top:solid #848484 thin; border-right:solid #848484 thin;"><span class="style3">First Name</span></td>
<td width="39" style="border-bottom:solid #848484 thin; border-left:solid #848484 thin; border-top:solid #848484 thin; border-right:solid #848484 thin;"><span class="style3"><?php echo $first; ?></span></td>
</tr>
<?php if ($last == 0) { ?>
<?php } else { ?>
<tr>
<td width="21" style="border-bottom:solid #848484 thin; border-left:solid #848484 thin; border-top:solid #848484 thin; border-right:solid #848484 thin;"><span class="style3">Last Name</span></td>
<td width="39" style="border-bottom:solid #848484 thin; border-left:solid #848484 thin; border-top:solid #848484 thin; border-right:solid #848484 thin;"><span class="style3"><?php echo $last; ?></span>
</td>
</tr>
<?php } ?>
<tr>
<td width="21" style="border-bottom:solid #848484 thin; border-left:solid #848484 thin; border-top:solid #848484 thin; border-right:solid #848484 thin;"><span class="style3">E-Mail</span></td>
<td width="39" style="border-bottom:solid #848484 thin; border-left:solid #848484 thin; border-top:solid #848484 thin; border-right:solid #848484 thin;"><span class="style3"><?php echo $email; ?></span></td>
</tr>
</table>
<?php
$message = ob_get_clean();
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = false;
$mail->SMTPAuth = false;
$mail->SetFrom('[email protected]', 'Example');
$mail->AddAddress('[email protected]');
$mail->Subject = "Call Back Request From example.com";
$mail->MsgHTML($message);
if ($mail->Send())
echo $mail = "Mail Sent!";
else
echo $mail = "There is an error while sending a mail:" . $mail->ErrorInfo;
?>
テストメールをWP Mail SMTPプラグイン経由で送信すると、受信トレイにそのメールが届いていますか? – purvik7373