简体   繁体   English

如何在mailto中输入$ email

[英]how to enter $email into mailto

i created a table to view user details where all the detils would be retrieved from the database. 我创建了一个表以查看用户详细信息,将从数据库中检索所有detil。 i want to set the retrieved emal address as a link so it could open in the default email application. 我想将检索到的Emal地址设置为链接,以便可以在默认电子邮件应用程序中打开。 this code here works but in the To: textbox [default email app], the email address is not correctly displayed i want to know how to enter $email into mailto i would request someone to pls provide me some help 此代码在这里有效,但在“ 收件人:”文本框[默认电子邮件应用]中,电子邮件地址未正确显示我想知道如何在mailto中输入$ email,我将要求某人请给我一些帮助

if($query === false)
                                {
                                    throw new Exception(mysql_error($conn));
                                }
                                while($row=mysqli_fetch_array($query))
                                {
                                    $tea_id=$row['tea_id'];
                                    $fname=$row['fname'];
                                    $lname=$row['lname'];

                                    $email=$row['email'];

                                     $username = $row['username'];
                        ?>
                <tr>
                      <td><?php echo $row['tea_id'] ?></td>
                    <td><?php echo $row['fname'] ?></td>
                     <td><?php echo $row['lname'] ?></td>

                    <td>

                           <?php 

                           // echo $row['email']
                           echo ('<a href="mailto:****">' . $email . '</a>')


                        ?>

                           </td>

---------------------------------------CLICK HERE TO VIEW CODE----------------------------------- ---------------------------------------点击此处查看代码------ -----------------------------

<td>
echo "<a href='mailto:".$email."?Subject=Contact%20Form&body=This is content' target="_top">".$email."</a>";
</td>

The email line should be : 电子邮件行应为:

echo '<a href="mailto:' . $email . '">' . $email . '</a>'

With a subject : 带有主题:

echo '<a href="mailto:' . $email . '?subject=' . $subject . '">' . $email . '</a>'

and ofcourse you should set the $subject variable first.. :) 当然,您应该先设置$subject变量。

您可以使用串联连接数据库中的mailto语句和email变量。

echo '<a href = "mailto:' . $your_email .'" . '</a>'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM