我是php的新手,我尝试发送邮件,但是......
if(isset($_POST['apmoketi'])){
$admin_email = "silumospausaulis@gmail.com";
$subject ='Užsakymas';
$comment = 'Jūsų užsakymas priimtas.'
//send email
mail( $subject, "RSVP from WC Entry Form",
"From: $admin_email, \n Name: $vardas $pavarde \n
Miestas: $miestas \n
Address: $postal \n ");
//Email response
echo "Thank you for contacting us!";}
我在php.ini
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP=smtp.gmail.com
;SMTP=smtp.mail.yahoo.com
; http://php.net/smtp-port
smtp_port=587
;smtp_port=587
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from=silumospausaulis@gmail.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
并在sendmail.ini
smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=auto
error_logfile=error.log
debug_logfile=debug.log
pop3_server=
pop3_username=
pop3_password=
force_recipient=
hostname=
错误: -
语法错误,意外发送邮件'第35行的C:\ xampp \ htdocs \ ch.php中的(T_STRING)
任何人都可以帮忙吗?
答案 0 :(得分:1)
由于您不熟悉PHP,因此调试始终是您的代码,看到行号。你可以在这里找到关于脚本PHP Parse/Syntax Errors; and How to solve them?
中常见错误的好参考$comment = 'Jūsų užsakymas priimtas.'; // you missing semicolon here