私はいくつかのSESSION変数をPHPメール関数に渡して、その情報を持つユーザに送ることができます。電子メールシステムは機能しますが、ユーザーに届いた電子メールには空の変数があります。PHPメールにvarsを渡そうとしています
//Start the session and add the variables to it (these are viewed on page before sending email out):
<?php
session_start();
// Continue the session
// retrieve session data
$amount = $_SESSION["vprice"];
$type = $_SESSION["vtype"];
$member = $_SESSION["vmember"];
//Variables viewed on the page:
<p style="text-align: center;">
Date: <?= date("Y/m/d")?><br>
Member ID: <?= $member?><br>
Order ID: <?= $abcOrderID?><br>
Order Type: <?= $type?><br>
Amount: <?= $amount?> €</p>
// Get users email address to send to:
<form method="post" action="email.php">
<p style="text-align: center;">
Send Confirmation E-mail to: <input type="text" name="email" value="" /></p>
<p style="text-align: center;"><input type="submit" name="submit" value="Send" /></p>
</form>
//Send the email using PHP mail()
<?php
//if "email" variable is filled out, send email
if (isset($_REQUEST['email'])) {
//Email information
$email = $_REQUEST['email'] ;
$message = "Thank you for ......" ;
// here we use the php mail function
// to send an email to:
// [email protected]
mail("[email protected]", "Online Submission",$message, "From: $email");
}
?>
//In email.php I use the following to build the message:
$mail->Body = "<p>Dear Member {$member1},</p><p>We have received your<strong> ABC payment</strong> and the purchased amount of {$amount1} in EUR will appear in your bank statement under the name ABC Ltd. Please keep this e-mail as a receipt for your records.</p><p>If you have any concern regarding this transaction, please do not hesitate to contact us</a>.</p><p> </p><p>Thank you,<br>ABC-Gym</p>";
私はそれを修正するために何かを試してきました。 何かアドバイスがありますか?
おかげで、 アンドレアス・M.
任意の差出人フィールドを使用して電子メールをなりすますことは、送信する評判を破壊する良い方法です。あなたはいつもあなたが管理しているアドレスから送信し、SPFレコードを設定することができます。元の送信者に返信できるようにするには、「Reply-To」フィールドを設定します。 – tadman