草庐IT

smtp-auth

全部标签

php - 是否可以将 sendmail 配置为默认使用 SMTP 身份验证(用于 PHP)?

我正在维护一个旧的PHP应用程序,我想将其配置为使用Mandrill用于传出电子邮件。当然,Mandrill需要SMTP身份验证。该应用程序直接使用PHP的mail()函数。有什么方法可以配置sendmail(或等效服务)默认使用SMTP身份验证发送(使用Mandrill的凭据),而不必替换整个过程中的所有mail()调用应用程序?我在php.ini中看到了一些关于SMTP配置的其他答案,但这只适用于Windows,所以我相信我可以更改的唯一可能有用的PHP设置是sendmail_path,默认为发送邮件-t-i。我在想也许我可以将它指向一个shell脚本,但我不确定如何去做或者它是否

PHP Mailer 错误 : Message could not be sent. Mailer Error: SMTP connect() failed

这是我的代码:require'phpmailertesting/PHPMailerAutoload.php';$mail=newPHPMailer;//$mail->SMTPDebug=3;//Enableverbosedebugoutput$mail->isSMTP();//SetmailertouseSMTP$mail->Host='send.one.com';//SpecifymainandbackupSMTPservers$mail->SMTPAuth=true;//EnableSMTPauthentication$mail->Username='myemailhidden';

php - 我可以在不发送电子邮件的情况下使用 SwiftMailer 对 SMTP 进行身份验证吗

我正在尝试使用Laravel中的SwiftMailer验证登录凭据。我需要在不实际发送电子邮件的情况下验证SMTP服务器的登录凭据。我正在尝试做这样的事情:$client=Swift_SmtpTransport::newInstance($smtpServer,$smtpPort,'ssl');$client->setUsername($this->smtpUser);$client->setPassword($this->smtpPass);$client->authenticate();Swift_SmtpTransport上没有authenticate()方法,但如果有类似的东西

php - SMTP 错误 : Could not connect to SMTP host. 邮件程序错误:SMTP 错误:无法连接到 SMTP 主机

大家好,我是php和html新手,面临问题:SMTP错误:无法连接到SMTP主机。邮件程序错误:SMTP错误:无法连接到SMTP主机。但在本地xampp中工作正常,在服务器中出现错误。代码如下:Name:$nameContact:$contactEmail:$emailCompany:$companyMessage:$message";require_once('mailer/class.phpmailer.php');$mail=newPHPMailer();$mail->IsSMTP();$mail->Host="smtp.gmail.com";$mail->SMTPDebug=0

php - 错误 : Transport config "Smtp" is missing in cakephp 3. x

cakephp3.x中缺少传输配置“Smtp”我试过一些配置如下:'EmailTransport'=>['default'=>['className'=>'Smtp','host'=>'ssl://smtp.gmail.com','port'=>465,'username'=>'xxxxxxxxx@gmail.com','password'=>'xxxxx',],],'Email'=>['default'=>['from'=>array('site@localhost'=>'DataMining'),'transport'=>'Smtp','charset'=>'utf-8','hea

php - 拉维尔 5 : No hint path defined for [Auth]

我正在加载邮件View$this->mail->send('auth::emails.email_confirmation',['url'=>$confirmationEmailUrl],function($m)use($user,$toMail){$m->to($toMail,$user->name)->subject('mail');});和服务提供商publicfunctionregisterViews(){$viewPath=base_path('resources/views/modules/auth');$sourcePath=__DIR__.'/../Resources/

php - $this->Auth->identify();在 cakephp 3.2 中返回 false

我已经在cakephp3.2中完成了登录的所有设置,但是在登录时它返回false。用户Controller中的登录函数publicfunctionlogin(){$this->viewBuilder()->layout('');if($this->request->is('post')){$user=$this->Auth->identify();pj($user);//returningfalseif($user){$this->Auth->setUser($user);return$this->redirect($this->Auth->redirectUrl());}$this-

php - Laravel [5.2.21] 自定义 Auth Guard 不持久

我正在尝试设置自定义身份验证保护,一切正常。我能够登录Model,但是一旦我将访问者重定向到新页面,身份验证就会丢失。我可以在Controller执行重定向之前dd()Auth::guard('client')->user()就好了,但是在AuthenticateClient中间件。我正在使用默认的保护程序来验证用户,并且一切正常。我已确保路由位于启用session的web中间件下。我搜索过类似的问题,但找不到有效的解决方案。有什么解决办法吗?旁注:我知道我在下面的代码示例中使用了token,但我所做的不仅仅是针对该token进行验证。所以这是一个不同于为api验证token的系统。路

PHPMailer SMTP 本地主机,证书错误

我们使用PHPMailer。服务器配置为使用本地SMTP。所以,一般的PHPMailer突击队看起来像这样:$mail=newPHPMailer();$mail->From='info@localdomain.com';$mail->Host='localhost';$mail->IsSMTP();...从PHP5.6开始,这不再有效,因为证书不匹配。我们收到以下错误:Warning:stream_socket_enable_crypto():PeercertificateCN='*.thisvps.com'didnotmatchexpectedCN='localhost'in/ho.

php - 尝试在 View 上访问 Auth::user()->name 时尝试获取非对象 [Laravel] 的属性

我正在尝试使用以下方法从View中获取用户名:Auth::user()->name我得到了尝试获取非对象的属性因为Auth::user()是NULL。这怎么可能?laravel生成的导航栏使用相同的方法,并且可以在那里工作。编辑:似乎我什至无法从Controller获得授权用户。Auth::guard('admin')->check();//trueAuth::user();//null有什么想法吗? 最佳答案 好吧,我又想通了,因为我使用了自定义守卫,所以我实际上需要使用:Auth::guard('admin')->user()-