Why I When I using mailgun for sending from yahoo mail or sending to yahoo mail it not works? - laravel

when i using gmail email it can be reset and set the from recipents
but when using yahoo mail the set from doent send and reset to yahoo address was error with
Expected response code 250 but got code "554", with message "554 Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in Account Settings. "

Did you check out this page?
If this is the cause you could try sending an text-only e-mail for testing purposes, see if that does works.

Related

I got this error when i shoot the mail through mailgun.org in laravel8

Expected response code 354 but got code "421", with message "421 Domain sandbox4412497ba418406ba96c4a5332029424.mailgun.org is not allowed to send: Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in Account Settings.
Like the message says you are using the test domain in mailgun.com. When using test domains you must add email addresses that are allowed to receive emails.
You can go to domain settings in mailgun add add recipient address to "Authorized Recipients".

send email in laravel by gmail smtp server

I want to use Gmail to send emails through Laravel.
When I apply through localhost, the email is sent correctly.
But it gives the following error on the server and the email is not sent.
local.ERROR: Swift_TransportException: Connection could not be established with host smtp.gmail.com $:stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 (Connection timed out)
Hello I had the same problem probably your solution is like that, because this helps me to resolved my issue
Create a custom app in you Gmail security settings.
Log-in into Gmail with your account
Navigate to https://security.google.com/settings/security/apppasswords
In 'select app' choose 'custom', give it an arbitrary name and press generate
It will give you 16 chars token.`
Use the token as password in combination with your full Gmail account and two factor authentication will not be required.
Note: The link in step 2 will work only if you have 2-factor-authentication enabled.
For Refference: link
use mail trap for testing
link https://mailtrap.io/ where you get your all smtp credential and put in .env file

How to catch mailgun errors in laravel

I have mailgun set up and working just fine. The problem occurs when I try to send an email to an email which doesn't exists. Use can put any email so if the email is correct mailgun sends it perfectly. But if it is incorrect it generates an error in laravel applications
Swift_TransportException (554)
Expected response code 250 but got code "554", with message "554 Free
accounts are for test purposes only. Please upgrade or add the address to
authorized recipients in Account Settings.
How can I catcth this exception in laravel without generating errors?

MailGun Laravel - Cant send to gmail

I have mailgun setup and working with my custom domain name, as in, I can send test emails to me#mydomain.com but when I try to send to gmail I get the following error.
ClientException in RequestException.php line 107:
Client error: `POST https://api.mailgun.net/v3/mydomain.com/messages.mime` resulted in a `400 BAD REQUEST` response:
{
"message": "Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the act (truncated...)
My mailgun account is setup to work with my domain name correctly and my custom email address doesn't match my site domain name and mail gets delivered to it from mailgun no problems...
MAIL_DRIVER=mailgun
MAILGUN_DOMAIN=mydomain.com
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=postmaster#mydomain.com
MAIL_PASSWORD=ljhasdlkfhklahsdfklhklasdhflkhasdlkfhkhasdkflh
MAILGUN_SECRET=key-asdflkhjaklsdfkljaslkdfjlkjasdfkj
MAIL_FROM=postmaster#mydomain.com
MAIL_ENCRYPTION=tls
Its weird that when trying to send to a gmail address it gives tells me I need to activate my mailgun account but when sending to a custom domain name address its works perfectly, anyone have any ideas.. Here is the function I am using to send the emails
Mail::send('emails.recontact', ['title' => $title, 'content' => $content], function ($message) use ($request){
$message->from( 'me#mysite.ie', $request->input('name') );
$message->to('myname#gmail.com');
$message->subject("Website Enquiry");
});
You may need to activate you account.
Please login to your mailgun account and make sure there is no a yellow message on the top of the screen that said:
"Please activate your account to start sending emails. We sent an activation email to {your_email}. Resend activation. Update email address."
This solved my problem :)
I am working on mailgun but i faced different problem when recipient reply mail stores instead of delivered

Spring mail MimeMessage has an incorrect "From " set

I am using spring mail to send an email via google's smptp server. I am setting my email templates "From" header but for some reason when I do receive the mail as a sender I get the owner of the smtp account. (which happens to be me again).
MimeMessage message = mailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message);
helper.setText(forgottenPassowrdMailTemplate.getText()
.replace("%firstName%", token.getUser().getFirstName())
.replace("%lastName%", token.getUser().getLastName())
.replace("%link%", url + token.getToken()), true);
helper.setTo(token.getUser().getEmail());
helper.setFrom(forgottenPassowrdMailTemplate.getFrom());
helper.setSubject(forgottenPassowrdMailTemplate.getSubject());
am I forgetting something ? I a am explicitly setting the "From" header
You are setting a from address that is different from the account's address. There are security measures by Google to avoid abuse, which could be fatal if you could just send with any arbitrary from address via Google's SMTP server. You need to link and verify your other account with the account you want to send the mail with. See here. Your original email address will still be available in the headers and visible to the receipient.
But why don't you just use the other accounts credentials (and mail server, if it is not a Google account)?

Resources