php
  • html
  • css
  • email
  • 2017-11-17 2 views -2 likes 
    -2

    私は、hrefでアンカータグにボタンを挿入しようとしています。私は、ユーザーがボタンではなく、リンクを見てみたいPHPメール機能でボタンを追加するには?

    <a href='http://example.com/PhpProject3/reset_passwd.php?key="<?= $email; ?>"&userid="<?= $userid; ?>"' style=' background-color: #4CAF50;border: none;color: white;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;font-size: 16px;'>Click To Reset password</a> 
     
    

    +0

    をお試しくださいはい、ボタンのように見えます。だからあなたの質問は何ですか? –

    +0

    @shrithi質問は正しくありません。あなたはメールをHTMLコンテンツにする必要があると思います。その中にパスワードをリセットするためのリンクボタンが必要ですか? – Darshan

    +0

    ヘッダー付きのメールを試しましたか? –

    答えて

    2

    あなたはこのようなあなたのメールにHTMLを使用することができます。

    <?php 
    $to = "[email protected], [email protected]"; 
    $subject = "HTML email"; 
    
    $message = "<a href='http://example.com/PhpProject3/reset_passwd.php?key=".$email."&userid=".$userid."' style=' background-color: #4CAF50;border: none;color: white;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;font-size: 16px;'>Click To Reset password</a>"; 
    $message .= "Other Information "; 
    
    // Always set content-type when sending HTML email 
    $headers = "MIME-Version: 1.0" . "\r\n"; 
    $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; 
    
    // More headers 
    $headers .= 'From: <[email protected]>' . "\r\n"; 
    $headers .= 'Cc: [email protected]' . "\r\n"; 
    
    mail($to,$subject,$message,$headers); 
    ?> 
    
    +0

    ご協力ありがとうございます@SN Tiwari – Shruti

    +0

    ようこそ@シュルティ –

    -2

    この

    <a href='http://example.com/PhpProject3/reset_passwd.php?key=".$email."&userid=".$userid."' style=' background-color: #4CAF50;border: none;color: white;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;font-size: 16px;'> 
        <button>Click To Reset password</button> 
        </a>"; 
    
    関連する問題