-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
smtp e-mail issue #7700
Comments
Not sure what's causing this issue; Someone needs to investigate and determine the cause of this issue. |
Your config above seems correct after checking the Swift_SmtpTransport class. You may need to debug the executeCommand manually (var_dump everywhere?). |
It does work, however you need to make sure you add your configuration into a new file (email.yml) like so: mysite/_config/email.yml ---
Name: myemailconfig
After:
- '#emailconfig'
---
SilverStripe\Core\Injector\Injector:
Swift_Transport:
class: Swift_SmtpTransport
properties:
Host: mail.example.com
Port: 587
Encryption: tls
calls:
Username: [ setUsername, ['mailadmin@example.com'] ]
Password: [ setPassword, ['examplepass1'] ]
AuthMode: [ setAuthMode, ['login'] ] When I do this I get the following error:
Which feels expected to me |
I've added a clarification to the docs regarding this too |
@dhensby Thanx - but nothing changed. mail->send() returns false and there is no error. I have created email.yml and flush. Still it is not working.. It is very sad that I can not get any output why it is broken or why it returned false.. There must be an option that getting output about what is gonna wrong about it. |
in Swift_SmtpTransport class var_dump($host) in __construct method prints nothing. I think it is never loaded. I don't know what to do then :=) Am I have to do something else, another config option for email option ?? I didn't understand, the class is not loading at all and there is no error message just returns false. And interesting thing is I can get $email->getSwiftMessage() message or with $email->debug - I can see sender mail and message before email->send() method. But $email->send() is not working :=) |
What happens when you debug out If it's not returning a |
The output is
|
yep, so it's using I have tested this with 4.x-dev and can confirm it works with the yaml I've provided. |
But I have added email.yml as you have described.. What can I do extra ?? My code is very simple ..
I think email.yml is not loaded because of cache maybe I don't know, but I have used ?flush too... My version is 4.0.0 |
You'll need to debug your code and find out why the wrong mailer is being created by |
email.yml is
|
there's an error in that yaml, it needs to be: ---
Name: myemailconfig
After:
- '#emailconfig'
+---
SilverStripe\Core\Injector\Injector:
Swift_Transport:
class: Swift_SmtpTransport
properties:
Host: mail.example.com
Port: 587
Encryption: tls
calls:
Username: [ setUsername, ['mailadmin@example.com'] ]
Password: [ setPassword, ['examplepass1'] ]
AuthMode: [ setAuthMode, ['login'] ] |
Thanx. Now the object is Swift_SmtpTransport :=) I still get return false but maybe it is related with something else... I think it would be nice - that something about debug option that what is wrong while sending mail. (i.e password wrong or other smtp errors ) |
If anyone looking for something output error like me :=) in abstract class Swift_Transport_AbstractSmtpTransport - _doMailTransaction method - You can get error message
|
As an aside, it's interesting that your YML got grouped in with the block header instead of the body... I wonder if we should validate that and raise that error earlier, in |
Raised at silverstripe/silverstripe-config#27 |
Affected Version
4.0.0
Description
I can not send e-mail with mail function with using smtp. I can not produce any error too ? I think there must a debug option.
I have added settings to config.yml
I tried to get print out swift mailer transport host and other stuff but I can't. It seems null.
The text was updated successfully, but these errors were encountered: