2016-05-03 9 views
-2

どのようにWordPressの設定をsmtpに設定すると、実際にはhttp://snvenkataraman.com/このWebサイトは、aws server.Useプラグインの連絡先フォーム7とWPメールSMTPプラグインで 連絡フォームが動作しません。 ! [] [2] 私の電子メールの設定は次のとおりです。名前から[email protected]、 :メールからどのようにWordPressのWebサイトでsmtp電子メールを設定することができます

ABC

メーラー:

リターンパス: SMTPオプション

SMTPホスト:smtp.gmail.com SMTPポート:25 暗号化: 認証: ユーザー名:[email protected] パスワード:****** テストメールを送信する:[email protected]

+0

テストメールをWP Mail SMTPプラグイン経由で送信すると、受信トレイにそのメールが届いていますか? – purvik7373

答えて

0

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; 
?> 
関連する問題