以前,这个应用程序是由最初的作者在Amazon中构建和托管的。然后,由于亚马逊更改为Godaddy的一些问题,这里的问题是发送电子邮件,忘记密码的邮件等,甚至上传图片不工作,当应用程序在Godaddy,并在亚马逊是完美的工作。
我在谷歌上搜索了一些关于AWS的信息;了解到作者在我的symfony应用的vendor文件夹中安装了第三方的aws-sdk-php;使用了一些桶来存储等等
所以在应用程序中,我在config中找到了一些AWS的变量。yml,配置。yml, parameters.yml。简单地说,我注释了所有这些变量,并更改了parameters.yml
中的代码from_email_address: xxxxxx@xxx.com
mailer_transport: smtp
mailer_host: email-smtp.us-west-2.amazonaws.com
mailer_user: xxxxxxx
mailer_password: xxxxxxx
locale: en
secret: xxxxxxxxx
debug_toolbar: true
debug_redirects: false
use_assetic_controller: true
amazon_s3.key: xxxxxxx
amazon_s3.secret: xxxxxx
amazon_s3.region: eu-west-1
from_email_address: xxxxx@xx.com
# mailer_transport: smtp
# mailer_host: email-smtp.us-west-2.amazonaws.com
# mailer_user: xxxxxxx
# mailer_password: xxxxxxx
mailer_transport: gmail
mailer_host: smtp.gmail.com
mailer_user: xxxxx@xx.com
mailer_password: xxxxxxx
locale: en
secret: xxxxxxx
# debug_toolbar: true
# debug_redirects: false
# use_assetic_controller: true
# amazon_s3.key: xxxxxxx
# amazon_s3.secret: xxxxxxx
# amazon_s3.region: eu-west-1
我还从
更改了控制器中的代码$maildata = array(
"name" => $userinfo->getFullname(),
"email" => $userinfo->getEmail(),
"code" => md5($userinfo->getUid())
);
$email = $this->get('emails_handler');
$subject = "Quotemyhouse.com account verification request.";
$message = $this->renderView('AppBundle:Emails:welcomeEmail.html.twig', $maildata);
$email->sendEmail($userinfo->getEmail(), $subject, $message);
$maildata = array(
"name" => $userinfo->getFullname(),
"email" => $userinfo->getEmail(),
"code" => md5($userinfo->getUid())
);
$message = $this->renderView('AppBundle:Emails:welcomeEmail.html.twig', $maildata);
$Subject = "Quotemyhouse.com account verification request.";
$msg = 'Swift_Message::newInstance()
->setSubject($Subject)
->setFrom($userinfo->getFullname())
->setTo($userinfo->getEmail())
->setBody($message,'text/html');
$this->get('mailer')->send($msg);
上述更改了配置中的详细信息。yml ,参数。yml正在使用本地主机中的示例电子邮件发送项目。
所以我希望你能理解我所面临的问题…提前感谢……我希望所有smtp配置在您的GoDaddy帐户是工作的。在goDaddy邮件功能中,主机名必须保持"localhost"。所以不用
mailer_host: email-smtp.us-west-2.amazonaws.com
使用mailer_host:localhost
有些情况下你不需要给mailer_user
和mailer_password
。但是你必须不断尝试
我终于找到了解决这个问题的办法…问题可能是与Gmail参数在生活或可能是Gmail邮件参数只适用于本地主机。我不知道
Just I've changed the parameters with my Godaddy Account Email paramaeters (which we can find by logging into C-panel of respective account in Godaddy).
Godaddy的帐户/电子邮件页面中有两种类型的详细信息,请使用左侧推荐的SSL参数。
谢谢。