Support the ongoing development of Laravel.io →
posted 10 years ago
Mail
Last updated 2 years ago.
0

This might help:

"The Swift_RfcComplianceException exception is thrown when you feed Swift Mailer with an invalid e-mail address (invalid as in "does not follow the syntax defined in the RFC document", not as in "the account does not exist"). This can happen in any field that requires e-mail addresses (sender, recipient, CC...)."

Source: http://stackoverflow.com/questions/21574336/fatal-error-uncaught-exception-swift-rfccomplianceexception-with-message-add

I have no clue why this error doesn't occur in Homestead though, unless you're using a different set of data on the Forge (live) site that may contain an invalid email address that doesn't exist in the Homestead environment.

Last updated 2 years ago.
0

Thanks sitesense,

Its totally wired. I have contact Forge support about it and Taylor seems to think it is a coding error.

I can't see it myself. If I <code>dd($data)</code> outside of Mail::, then it is fine. If I <code>dd($data)</code> inside Mail::, dd() doesn't even get hit, it goes straight to the Swift Exception complaining..

public function send_email($data)
    {
        // dd($data);
        // This dd gets hit and all data is correct.

        Mail::send('movo/messages::emails.'.$data['template'], [ 'content' => $data['message'] ], function($message) use ($data)
        {
            // dd($data);
            // This dd isn't even reached. I just the error complaining that the email address isn't valid.

            // Get the users email details
            $email = EmailAccounts::find($data['from']);

            // Fire our the email
            $message->from($email->email_address, $email->send_name);
            $message->to($data['to']);
            $message->subject($data['subject']);

        });
    }

Thanks for your feedback though. Two days down now! I hate these little issues.

Last updated 2 years ago.
0

If the second dd() doesn't get reached, it kind of suggests that the error is here:

Mail::send('movo/messages::emails.'.$data['template'], [ 'content' => $data['message'] ], function($message) use ($data)
{

I might have an idea on this though... I saw a post the other day about Homestead and Forge treating case sensitivity differently.

Are you sure that the route to your template is correct and of the exact same case?

Since the second dd() isn't reached and therefore no email address has actually been given to the mailer, perhaps the error is a red herring and it is in fact the route that isn't found?

I dunno, good luck :)

Last updated 2 years ago.
0

Hmmm. Thanks sitesense.

That sounds like a lead. I'll double check everything. Many thanks for pointing that out. I'll report back for others if I find anything.

Cheers.

Last updated 2 years ago.
0

Adding to the confusion!

If Laravel is set: debug => true, then the email sends. If false then it fails!

Very strange. I'm asking Taylor to take a look at it.

Anyone experienced this issue?

Last updated 2 years ago.
0

Did you find a solution for this? I'm getting it on Forge as well.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

T2theC t2thec Joined 5 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.