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...)."
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.
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.
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 :)
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.
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?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community