My email setting in env like this :
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=secret#gmail.com
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=tls
It works. But, I want to change email sender. So I don't use email sender gmail
My boss gives me a new email setting like this :
Mail Client Manual Settings
Secure SSL/TLS Settings (Recommended)
Username:contact#secretshop.id
Password:secret
Incoming Server:
palasik.in-hell.com
IMAP Port: 9xx
POP3 Port: 9xx
Outgoing Server:
palasik.in-hell.com
SMTP Port: 465
IMAP, POP3, and SMTP require authentication.
Non-SSL Settings (NOT Recommended)
Username:contact#secretshop.id
Password:secret
Incoming Server:
mail.secretshop.id
IMAP Port: 1xx
POP3 Port: 1xx
Outgoing Server:
mail.secretshop.id
SMTP Port: 587
IMAP, POP3, and SMTP require authentication.
I want to ask some questions
What is the difference between Secure SSL / TLS Settings and Non-SSL Settings?
what is the difference between incoming Server and Outgoing Server?
What new setting is more suitable?
I tried like this:
MAIL_DRIVER=smtp
MAIL_HOST=mail.secretshop.id
MAIL_PORT=587
MAIL_USERNAME=contact#secretshop.id
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=tls
Is it the best choice?
Its always recommended to use SSL as it is secured & reduces the changes of the sent mail being filtered by the recipient's host as spam.
Most email accounts have two servers:
one that lets you send emails to other people,
and another that lets you receive the emails that other people send
you.
The server that lets you send mail is called an outgoing, or SMTP server. The server that lets you receive mail is called an incoming, POP, or just Mail server.
To change the sender config in Laravel use in .env file:
MAIL_DRIVER=smtp
MAIL_HOST=palasik.in-hell.com
MAIL_PORT=465
MAIL_USERNAME=contact#secretshop.id
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=ssl
You can setup the config on config/mail.php or on the .env of your app.
Related
I'm getting this error when sending an email via Office 365 from a Laravel system.
But the peculiarity is that it is random. It is not a mail configuration problem. Sometimes it works, sometimes it gives the error.
I think Office 365 is doing a lock. But the error message confuse me.
Has it happened to someone? Thanks!
Connection could not be established with host smtp.office365.com :stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known site:stackoverflow.com
if you are sure that you configure the mail correctly
MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME= //your username
MAIL_PASSWORD= //your password
MAIL_ENCRYPTION=tls
according to this issue discussions, it seems that it may related to WHM/Cpanel Users-- there is a tweak setting that may be tripping you up and redirecting outgoing email connections to localhost (which is then rejecting your connection).
https://features.cpanel.net/topic/change-fka-smtp-tweak-behavior-to-encourage-correct-user-behavior
if your are using GoDaddy Linux hosting try this:
mail_mailer=smtp
mail_host=localhost //using localhost cause we are in the same domin
mail_port=25
mail_username= //keep it empty
mail_password= //keep it empty
mail_encryption= // keep it empty
mail_from_address=username#udomin.com//this same for your email username
mail_from_name=stackoverflow // any name
see we are use this setting because we are in the same serve
MAIL_DRIVER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=some-email#gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=ssl
I tried ssl and tls with their respective code but shows Swift_TransportException
Connection could not be established with host smtp.gmail.com [Connection timed out #110]
Mail::send('email.contact', $data, function($message) use ($data){
$message->from($data['email']);
$message->to('abc#gmail.com', 'Admin');
});
Generally gmail is not recommended to send emails on live server, but if you just using it for testing purpose than make sure you have allowed less secure app to YES under https://myaccount.google.com/security and allow captcha at https://accounts.google.com/b/0/DisplayUnlockCaptcha.
After performing above actions just clear your cache and email should work fine.
You are trying with 465 port with SMTP which is fine but can to try with 587 port.
I'm trying to send an email from a spring boot application with spring mail (1.5.8.RELEASE) JavaMailSender
sending through gmail SMTP is fine. however sending email through my domain registrar's amtp (registrar name- 1and1, in case someone already worked this out) is not working.
I'm getting this error, which imo - is more generic than useful:
com.sun.mail.smtp.SMTPSenderFailedException: 550-Requested action not taken: mailbox unavailable
550 invalid DNS MX or A/AAAA resource record
domain I'm sending through is bank.org, and has this DNS settings:
bank.org. 3600 IN A 178.79.161.205
bank.org. 3600 IN MX 11 mx01.1and1.com.
bank.org. 3600 IN MX 10 mx00.1and1.com.
the issue is, I'm able to send emails to gmail with the settings specified in this guide:
http://www.baeldung.com/spring-email
these are settings to send with gmail:
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=<login user to smtp server>
spring.mail.password=<login password to smtp server>
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
However when i try to send messages via my registrar these settings are not successful:
spring.mail.host=smtp.1and1.com
spring.mail.port=587
spring.mail.username=username
spring.mail.password=password
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
thew issue is - I am able to connect to the 1and1 SMTP using thunderbird email client. so I know the credentials are working.
I guess what I need is to find out a way to detect the correct settings because the support team can't assist with issues related to sending email programmatically from spring mail
the cause of the issue was - I didn't programmatically set the sender field (The "From" field) in my outgoing message
Once i set the From field the issue was resolved.
unfortunately the response from 1and1's SMTP was irrelevant ("550 invalid DNS MX or A/AAAA resource record")
Hope this helps anyone
Below is my configuration on mail in .env file.
MAIL_DRIVER=smtp
MAIL_HOST=mail.domain.com
MAIL_PORT=587
MAIL_USERNAME=username#domain.com
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls`
When I used the http the above settings works fine, meaning, I can send mail to the client. But, when I used the https secured, it contains an error: Connection could not be established with host mail.domain.com [Connection refused #111]
I tried to use the port provided by the the host but still there is an error : connection timeout
I want to use the https since it is secured. Does anybody know how to fix this error on https?
I got it worked. I just changed the Mail driver to mail:
`MAIL_DRIVER=mail`
and the Mail_port assigned by the hosting.
I'm using Mandrill for my transaction email needs and it works great. Unfortunately very often when I send emails via my email client the emails go to the recipients spam folder.
Is there a way to use Mandrill for outgoing emails via a mail client (such as Apple Mail or Thunderbird)?
You can use the Mandrill's Outgoing Server (SMTP) Setting in the MailClient of your choice.
SMTP Settings
Outgoing Server: smtp.mandrillapp.com
Outgoing Server Port: 587
Auth Required: True
TLS: True
Username: complete email-id
Changing the MailClient is not probably going to mark your mails as legitimate.
There are multiple reasons for mail going to spam folder of recipient like:
Mandrill's IP address got blacklisted in recipient's SMTP (MX) server.
Your mail contains some links or content which is recognized as suspicious and hence recipient marks such mails as spam.
In short, mail getting marked as spam depends upon:
Sender SMTP server's reputation.
Sender's mail content.
Receiving SMTP (MX) (i.e recipient's) server business logic for mail classification.