douling6469 2012-03-29 18:49
浏览 71

邮件不通过表单发送

This is the mail that should send (code in my PHP):

$message = 
"Hello 

Thank you for registering with us. Here are your login details...


User ID: $user_name
Email: $usr_email 
 
Passwd: $data[pwd] 


";

mail($usr_email, "Login Details", $message,
"From: \"Member Registration\" <xxxx@gmail.com>
" .
"X-Mailer: PHP/" . phpversion());

header("Location: thankyou.php");  
exit();

This is my php.ini details:

; For Win32 only.
; http://php.net/smtp
;SMTP = localhost
; http://php.net/smtp-port
;smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost

; 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"

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
;the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the
;filename
mail.add_x_header = Off

; Log all mail() calls including the full path of the script, line #, to address and 
;headers
;mail.log = "C:\xampp\apache\logs\php_mail.log"

and my sendmail.ini

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=25
error_logfile=error.log
debug_logfile=debug.log
auth_username=xxxx@gmail.com
auth_password=xxxxxxx
force_sender=xxxx@gmail.com

I'm a complete beginner so this could be totally wrong. When I submit the form where the mail function is, the thankyou.php page appears as specified

  • 写回答

2条回答 默认 最新

  • doudu5498 2012-03-29 18:53
    关注

    Check your mail logs to see if sendmail is having a problem delivering the message. Often your app can deliver it to sendmail correctly but sendmail can't send it out.

    评论

报告相同问题?

悬赏问题

  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上