Google App-Gmail无法从中设置。 Gmail通过swiftmailer发送时从地址中替换SMTP传输(PHP) [英] Google App-Gmail Unable to set from. Gmail replacing from address when sending via swiftmailer SMTP transport (PHP)

查看:224
本文介绍了Google App-Gmail无法从中设置。 Gmail通过swiftmailer发送时从地址中替换SMTP传输(PHP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,并且提前给予任何帮助。



我使用swiftmailer,SMTP传输方法从我的PHP脚本发送邮件。 b
$ b

发送消息很好。它的工作原理。

问题是,无论我将FROM,REPLYTO,SENDER设置设置为,电子邮件通过GMAIL邮箱(ME - me @ mydomain

  $ transport = Swift_SmtpTransport :: newInstance('imap.gmail.com',465,'ssl' )
- > setUsername($ login)
- > setPassword($ password)
;
$ message = Swift_Message :: newInstance($ subject)
- > setFrom(array('test@testdomain.com'=>'test mcttest'))
- > setReplyTo (array('test@testdomain.com'=&'test mcttest'))
- > setSender('test@testdomain.com')
- > setTo(array($ to) )
- > setBody(wordwrap($ body,70))
- > setContentType('text / plain')
;

所以电子邮件没有问题,而是来自 TEST-test @ testdomain。 com 作为发件人...它是 ME-me@mydomain.com



我切换到单独的(非Gmail )SMTP服务器测试和电子邮件通过罚款,没有任何问题......绝对认为这是一个GMAIL的东西。



任何人都知道如何解决这个问题?

解决方案

是的,Gmail会将发件人电子邮件地址更改为您正在验证的帐户。目前没有解决方法,除了成为Google Apps的付费客户。


Hello and thank you for any help in advance.

I'm using swiftmailer, SMTP transport method to send email from my PHP script.

Sending the message is fine. It works.

The problem is, no matter what I set the FROM,REPLYTO,SENDER settings to, The email comes through as the GMAIL mailbox (ME - me@mydomain.com) instead.

$transport = Swift_SmtpTransport::newInstance('imap.gmail.com', 465,'ssl')
    ->setUsername($login)
    ->setPassword($password)
    ;
$message = Swift_Message::newInstance($subject)
    ->setFrom(array('test@testdomain.com' => 'test mcttest'))
    ->setReplyTo(array('test@testdomain.com' => 'test mcttest'))
    ->setSender('test@testdomain.com')
    ->setTo(array($to))
    ->setBody(wordwrap($body, 70))
    ->setContentType('text/plain')
    ;

So the email goes through fine, but instead of being from TEST-test@testdomain.com as the sender... it's ME-me@mydomain.com

I switch to a separate (non-gmail) SMTP server to test and the email went through fine, without any problems... definitely think it's a GMAIL thing.

Anyone know how to get around this?

解决方案

Yes, it is Gmail that changes the sender e-mail address to be the same of the account you are authenticating. There is no workaround for that, except maybe becoming a paid customer of Google Apps.

这篇关于Google App-Gmail无法从中设置。 Gmail通过swiftmailer发送时从地址中替换SMTP传输(PHP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆