0

皆さんが笑う前にわかりました LOLZ --> これが GMAIL の問題なのか、何か間違っているのかわかりませんが、メッセージの本文にアクティベーション リンクのメールを挿入しようとしています。

$body = "Or click on this link: <a href=\"http://www.url.com/start/page.php?verify=true&id=".$url."&activate=".$ac."> Activate Your Account </a>"


ここでの問題は、私の GMAIL アカウントがこれを示していることです: (どちらのところでクリック可能で、正しくルーティングされます)

Or click on this link: <a href="http://www.url.com/start/page.php?verify=true&id=f22645cff5ecfd4d3c115af5&activate=75845> Activate Your Account </a>

ここで何が欠けていますか?これはGmailだけの問題ですか?どうすればこれを修正できますか? 表示してほしい:アカウントを有効にする

4

6 に答える 6

3

URL の末尾の引用符を閉じてみてください。

SO 構文の強調表示でも問題が示されました。

于 2012-09-07T00:26:07.920 に答える
1
  1. 間違った構文、

エラーは何が起こっているかを示しているはずです。

Parse error: syntax error, unexpected T_STRING on line x...

2. HTML メールを送信します。Content-type ヘッダーは html に設定する必要があります

私はいくつかの変更を加えてこれをテストしました。この作業スクリプトを試してください:

<?php
$body = 'Or click on this link: <a href="http://www.url.com/start/page.php?verify=true&id='.$url.'&activate='.$ac.'"> Activate Your Account </a>';
// To send HTML mail, the Content-type header must be set
$headers = 'From: webmaster@example.com' . "\r\n" .
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail("to@gmail.com","Subject goes here",$body,$headers);
?>

PHP メール

bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
于 2012-09-07T00:29:26.450 に答える
0

ここで二重引用符が欠落していることを確認してください。

<a href="http://www.example.com/...5845>

これは、代わりに次のように記述されます。

<a href="http://www.example.com/...5845">
于 2012-09-07T00:27:02.403 に答える
0

ヘッダーを設定していない場合、これでうまくいきます。もちろん、独自の変数を設定する必要があります。

                $sender_email = strip_tags($sender_email);
                $subject = "=?UTF-8?B?".base64_encode(strip_tags($title))."?=";
                $message = nl2br(strip_tags($message));
                $headers = "From: ".$sender_email.' <'.$sender_email.'>'."\r\n";
                $headers .= "MIME-Version: 1.0\r\n";
                $headers .= "Content-Type: text/html;\r\n";
                $headers .= "\tformat=flowed;\r\n";
                $headers .= "\tcharset=\"utf-8\";\r\n";
                $headers .= "\treply-type=original\r\n";
                $headers .= "Content-Transfer-Encoding: 8bit\r\n";
                $headers .= "Reply-To: ".$sender_email."\r\n";

                $body =  __('sendfriend:defaultmessage') . '<br /><br/><a href="'.$link.'" title="'.$title.'" target="_blank">'.$link.'</a><br/><br />'.$message;
                $mail = mail($recipients, $subject, $body, $headers);
于 2012-09-07T00:28:15.757 に答える
0

メールは必ず HTML メールとして送信してください。

$headers = "From: myEmail@example.com\r\n";
$headers .= "Content-Type: text/html\r\n";
mail(...$headers);

メール関数の最後に $headers 変数を追加します。

于 2012-09-07T00:29:52.043 に答える
0

最初にメール機能でヘッダーを定義します

  $headers = 'From: abc@example.com' . "\r\n" .
  $headers  = 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
于 2012-09-07T06:07:41.667 に答える