【发布时间】:2019-12-05 10:12:46
【问题描述】:
当用户输入数据并提交时,我有一个表单,它将转到他的邮件,现在我无法将我的徽标保存在邮件中,下面是我的邮件 php 代码
<?php
if(isset($_POST['submit'])){
$to = "contact@bolstersolutions.com"; // this is your Email address
$from = $_POST['name1']; // this is the sender's Email address
$first_name = $_POST['name2'];
$last_name = $_POST['email2'];
$last_name1 = $_POST['number1'];
$subject = "Referal";
$subject2 = "Your Friend " . $from . " Has Referred You To Us For UK Process";
$message = $from . " has refered the following student :" . "\n\n" . $first_name. "\n\n" .$last_name. "\n\n" .$last_name1;
$message2 = "Your friend " . $from . " has referred you to Bolster Solutions for UK process. We will be more than happy to process your applications, thus helping you in achieving your goals to study MS in UK." . "\n\n" . "Feel free to go to the following url for more information or else you can also call us @ +91 9666999430 / 7661919191." . "\n\n" . "URL: https://consultancy.bolstersolutions.com/mail/" . "\n\n" . "Thanks and Regards." . "\n\n" . echo "<img src='https://consultancy.bolstersolutions.com/mail/assets/img/logo.png'>" ;
$headers = "From:" . $from;
$headers2 = "From: Bolster Solutions " . $to;
mail($to,$subject,$message,$headers);
mail($last_name,$subject2,$message2,$headers2);
}
?>
发生以下错误:
解析错误:语法错误,C:\xampp\htdocs\mail\index.php 中出现意外的 'echo' (T_ECHO)
谁能帮帮我,在此先感谢。
【问题讨论】:
-
在那个位置使用
echo是没有意义的。您已经在此处处于字符串上下文中,因此您需要保持连接部分,而不是试图潜入回声。