Tag: phpmailer

PHPMailer – SMTP错误:从我的服务器发送邮件时,密码命令失败

我已经使用phpmailer()的概念,从我的共享服务器使用PHP脚本的用户发送邮件,但我不能够发送,即使一切都是正确的在我的脚本根据phpmailer代码。 我的代码是这样的: $message = " This is testing message from my server"; $mail = new PHPMailer(); // create a new object $mail->IsSMTP(); // enable SMTP $mail->Host = "smtp.gmail.com"; $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only $mail->SMTPAuth = true; // authentication enabled $mail->SMTPSecure = 'ssl'; // secure transfer enabled […]

PHPMailer中的“SMTP错误:无法validation”

我在一个简单的脚本中使用PHPMailer发送电子邮件的通过Gmail,我得到一个“未知的错误”(至less对我来说): SMTP错误:无法validation。 错误:SMTP错误:无法进行身份validation。 SMTP服务器错误:5.7.1用户名和密码不被接受。 了解更多信息,请访问535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 p38sm2467302ybk.16 我已经阅读了关于configurationOpenSSL的SSL / TLS连接,我做到了。 Apache和PHP是正确configuration的(使用OpenSSL扩展在PHP中运行,在Apache 2.2.16中运行mod_ssl)。 这是PHP脚本: <?php require_once ("PHPMailer\class.phpmailer.php"); $Correo = new PHPMailer(); $Correo->IsSMTP(); $Correo->SMTPAuth = true; $Correo->SMTPSecure = "tls"; $Correo->Host = "smtp.gmail.com"; $Correo->Port = 587; $Correo->UserName = "foo@gmail.com"; $Correo->Password = "gmailpassword"; $Correo->SetFrom('foo@gmail.com','De Yo'); $Correo->FromName = "From"; $Correo->AddAddress("bar@hotmail.com"); $Correo->Subject = "Prueba con PHPMailer"; $Correo->Body = "<H3>Bienvenido! Esto […]

configurationWAMP服务器发送电子邮件

有没有一种方法可以configurationPHP的WAMP服务器来启用mail()函数?

通过PHP邮件function发送电子邮件到垃圾邮件

我在将邮件发送到我的收件箱(Gmail帐户)时遇到问题,但每次都发送到垃圾邮件文件夹。 这是代码片段 //$ticketDetail is array which contain required information to send. sendOwnershipEmail('dineshnagarscriet@gmail.com', $ticketDetail); function sendOwnershipEmail($email, $ticketDetail) { $param = new stdClass(); $param->content = "<div> <div><b>".$ticketDetail[0]['ticket_number']."</b></div><br/> <div><img src='".$ticketDetail[0]['image_path']."'/></div><br/> <div>Ticket with ticket number ".$ticketDetail[0]['ticket_number']." has been requested for tranfer from <div/> <div>".$ticketDetail[0]['oldDepartment']." to ".$ticketDetail[0]['newDepartment']." Department <div/> </div>"; $param->sendTo = $email; $param->subject = "Request for Department transfer"; sendMailFunction($param); […]

从表单发送文件附件使用phpMailer和PHP

我有一个example.com/contact-us.php上的表单,看起来像这样(简化): <form method="post" action="process.php" enctype="multipart/form-data"> <input type="file" name="uploaded_file" id="uploaded_file" /> <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /> </form> 在我的process.php文件中,我有下面的代码利用PHPMailer()发送一封电子邮件: require("phpmailer.php"); $mail = new PHPMailer(); $mail->From = me@example.com; $mail->FromName = My name; $mail->AddAddress(me@example.com,"John Doe"); $mail->WordWrap = 50; $mail->IsHTML(true); $mail->Subject = "Contact Form Submitted"; $mail->Body = "This is the body of the message."; 电子邮件正确发送正文,但没有upload_file的附件。 我的问题 我需要将表单中的文件uploaded_file附加到电子邮件中,然后发送。 在process.php脚本在电子邮件中发送它之后,我不关心保存文件。 我明白,我需要添加AddAttachment(); 某处(我正在假设在Body线下)附件发送。 […]