【phpasimplesmtpclass_php实例】教程文章相关的互联网学习教程文章

php-SMTP错误(220-我们未授权使用此系统来传输未经请求的220和/或批量电子邮件.)【代码】

我当前使用的是CodeIgniter 2.2.2,我的控制器内部包含以下代码:$config['protocol'] = "smtp";$config['smtp_host'] = "mail.domain.com";$config['smtp_port'] = "25";$config['smtp_user'] = "noreply@somedomain.com"; $config['smtp_pass'] = "password";$config['charset'] = "utf-8";$config['mailtype'] = "html";$config['newline'] = "\r\n";$config['wordwrap'] = TRUE;$this->load->library('email');$this->email->in...

php-Laravel发送默认电子邮件(不使用SMTP)【代码】

是否有可能在laravel中发送没有SMTP配置的默认php电子邮件?像在PHP中使用X-Mailer吗?解决方法:在几乎不希望指定发件人电子邮件的情况下,我使用标准的PHP mail()函数:$to = env('MAIL_USERNAME'); $subject = $request->title; $message = $request->message; $headers = 'From: ' . $request->email . "\r\n" . 'Reply-To: ' . $request->email . "\r\n" . 'X-Mailer: PHP/' . phpversion();

使用PHP邮件通过smtp发送

有人知道您是否可以配置php的mail()命令,使其仅使用SMTP服务器,而不使用本地sendmail吗?我们无法将电子邮件标记为垃圾邮件. 我们的服务器正在运行RedHat 5 Enterprise. 我知道各种充当SMTP客户端的PHP库,但我宁愿配置PHP,以便mail()直接使用SMTP服务器.解决方法:根据this manual page,只能在Windows上使用.

电子邮件-PHPMailer SMTP配置【代码】

在过去的2个小时里,我一直在网上寻找是否有其他人遇到此问题,而且看来还有很多问题,机器人没有任何答案对我有用.SMTP -> FROM SERVER:220 mx.google.com ESMTP vq7sm928004oeb.13 SMTP -> FROM SERVER: 250-mx.google.com at your service, [50.57.114.141] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250 ENHANCEDSTATUSCODES SMTP -> FROM SERVER:220 2.0.0 Ready to start TLS SMTP -> FROM SERVER: 250-mx.google.com at...

Mail.php和Smtp身份验证问题【代码】

我一直在尝试利用jquery可接触插件(可在google上找到)中的mail.php文件在我的网站上使用.尽管提供的脚本非常简单,但是我将其与主机的SMTP要求集成在一起时遇到了问题.这是没有SMTP身份验证的原始脚本:<?php// Assign contact info$name = stripcslashes($_POST['name']);$emailAddr = stripcslashes($_POST['email']);$issue = stripcslashes($_POST['issue']);$comment = stripcslashes($_POST['message']);$subject = stripcsla...

php – Codeigniter 2.1.3的SMTP Gmail错误【代码】

我见过很多与这个问题相关的帖子,我已经完成了给出的指令,但总是得到同样的错误.. 我想使用Code Igniter 2.1.3发送smtp gmail,这是代码:class Email extends CI_Controller{function index(){$config = Array( 'protocol' => 'smtp', 'smtp_crypto' => 'ssl', 'smtp_host' => 'smtp.gmail.com', 'smtp_user' => 'myEmail@gmail.com', 'smtp_pass' => '***********', 'smtp_port' => 25, 'mailtype' =...

php – Codeigniter 3发送没有smtp的电子邮件【代码】

虽然一切都很好,但我没有收到电子邮件.可能托管问题?任何建议将不胜感激.这是我的代码$this->load->library('email');$this->email->from('info@domain.com', 'Name');$this->email->to($seller_email);$this->email->subject('This is subject');$this->email->message('This is message!');$this->email->send();echo $this->email->print_debugger();print_debugger函数返回空.让我知道你们的评论.解决方法:完美的解决方案如下...

php – Codeigniter SMTP电子邮件错误【代码】

使用带有我的codeigniter应用程序的SMTP时,我无法收到要发送的电子邮件. 在SO上有很多类似的问题,但没有一个可以解决我的问题,所以这就是为什么我要再问一次. 这是我得到的错误:hello: The following SMTP error was encountered: Failed to send AUTH LOGIN command. Error:from: The following SMTP error was encountered:to: The following SMTP error was encountered:data: The following SMTP error was encountered:The f...

php – 身份验证失败[SMTP:STARTTLS失败(代码:220,响应:2.0.0准备启动TLS)]【代码】

我正在尝试使用SMTP和PEAR在PHP中发送带附件的电子邮件,但将错误视为“身份验证失败[SMTP:STARTTLS失败(代码:220,响应:2.0.0准备启动TLS)]”<?php require_once "Mail.php"; // PEAR Mail package require_once ('Mail/mime.php'); // PEAR Mail_Mime packge$from = "Your Mom <sender@gmail.com>"; $to = "Me <recepient address@gmail.com>"; $subject = 'Call Me!';$headers = array ('From' => $from,'To' => $to, 'Subject...

php – smtp relay – gmail – swiftmailer:预期的响应代码220但是得到了代码“”

我使用gmail作为我的swiftmailer类的smtp服务器. 但是我得到了Expected response code 220 but got code “”, with message “” in “\classes\Swift\Transport\AbstractSmtpTransport.php”这是什么意思?解决方法:我想这可能意味着你向smtp服务器发送了一个空行. 确保没有任何命令包含换行符. 您可以记录事务并粘贴日志副本吗? 有关日志记录的详细信http://swiftmailer.org/docs/logger-plugin

php – 如何处理Laravel的SMTP驱动程序中的自签名TLS证书?【代码】

我正在尝试发送包含此配置的电子邮件:return ['driver' => 'smtp','host' => 'mail.mydomain.com','port' => 26,'from' => ['address' => 'mailer@mydomain.com', 'name' => 'Mailer'],'encryption' => 'tls','username' => env('MAIL_USERNAME'),'password' => env('MAIL_PASSWORD'),'sendmail' => '/usr/sbin/sendmail -bs','pretend' => false,];当我提交表格时,我收到了这个erorr:ErrorExcep...

php – PEAR Mail无法连接到Gmail SMTP,无法连接到套接字【代码】

事实 我正在使用PEAR Mail,我想使用gmail SMTP发送邮件.我有Apache / 2.4.27(Win64)PHP / 7.2.0beta3,PEAR 1.10.15,Mail 1.4.1,Net_SMTP 1.8.0,Net_Socket 1.2.2. 我去了php.ini并添加了extension = php_openssl.dll. error.log不提供与ssl相关的错误. 这是代码require_once "Mail.php";$from = '<slevin@gmail.com>'; $to = '<slevinkelevra@gmal.com>'; $subject = 'Hi!'; $body = "Hi,\n\nHow are you?";$headers = array('From...

PHPMailer使用Gmail作为SMTP服务器.无法连接到SMTP主机.邮件程序错误:SMTP错误:无法连接到SMTP主机【代码】

我正在尝试使用phpMailer通过电子邮件向用户发送确认消息.我的代码是这样的:<?php include("class.phpmailer.php"); include("class.smtp.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "ssl://smtp.gmail.com"; // specify main and backup server $mail->Port = 465; // set the port to use $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "sender@...

php – mail():SMTP服务器响应:550 hmailserver上的地址无效错误【代码】

尽管将php.ini配置为有效的send_from地址,但我收到此错误.我知道它是有效的,因为当我从松鼠邮件发送它时它起作用但是当用php发送邮件时它将无效.无效地址可能是指send_from地址.所以我看不出它怎么会认为这是错的.这是PHP代码:$email="tobiasvogel1@googlemail.com"; $subject = "Your New Password"; $from="admin@dayshare.local"; $message = "Your new password is as follows:xxxxxxxxxxxxxxxxxxxxxxxxxxxThis email was aut...

php – SMTP服务器响应:530 5.7.0必须首先发出STARTTLS命令【代码】

SMTP服务器响应:530 5.7.0必须首先发出STARTTLS命令 当我在php脚本文件中使用mail()函数时,我收到此错误消息… 我使用的是使用STARTTLS的gmail SMTP服务器和gmail,它是安全的SSL以防止垃圾邮件我已经在我的contact.php文件中使用这些命令ini_set("SMTP","smtp.gmail.com"); ini_set("sendmail_from","<email-address>@gmail.com>");那么我可以使用什么命令启用STARTTLS或在php,ini文件中配置?解决方法:首先,确保PHP安装具有SSL支...

CLASS - 相关标签
实例 - 相关标签