please some one should help ive done all required to setup my mail queue.
on my route:
Route::get('/test-mail', function () {
Mail::to('***********#xxxx.com')->queue( new App\Mail\testMail());
echo "sent";
});
the mail is queued and stored in the DB and with my listener, i can see it is processed successfully but the mail for reasons i don`t know, is not received at my mailbox.
enter image description here
Related
I'm currently working on laravel mail. I've sending email structure with attachment like this:
$document = Document::find($request->document_id);
Mail::send('email.senddocs', array('project'=>$document->project->name,'type'=>$document->documentType->type), function($message) use($request,$document){
$file_name = public_path().'/documents/'.$document->project->p_key.'/'.$document->file_name;
$message->from('us#example.com', 'DDMS');
$message->to($request->email);
$message->attach($file_name);
});
I've already visited here. But, the process over there always returning success.
What I actually want is to know if mail is send or not. In my case, Mail sending can fail due to fake email like akdjbaksdjf#jhbasdhadfs.com or by some other errors occurred.
How can I know mail is sent or not ?
Any help is appreciated
This questions is asked several times here:
Laravel 5 - check if mail is send
You can use the failure method for this:
if( count(Mail::failures()) > 0 ) {
foreach(Mail::failures as $email_address) {
echo "$email_address <br />";
}
} else {
echo "Mail sent successfully!";
}
This only checks if a email was send. You can not handle not existing email adresses with this method.
You can use mailgun for this problem for example.
Another way is to use a php class which connects to a smtp server, and will check.
PHP class:
https://www.phpclasses.org/package/6650-PHP-Check-if-an-e-mail-is-valid-using-SMTP.html
Some Informationen of checking email adresses: How to check if an email address exists without sending an email?
I am new laravel and i just made a small project of article posting and on user registration i just want to send successfully register email to user email. I searched every where in all tutorials they are giving demo for send mail from gmail and some another email providers. I just want to know is it possible to send the mail simply from server email id ? like cordignator framework:
$this->email->to('rahul#gmail.com')
$this->email->subject('Testing Email')
$this->email->message('hello')
$this->email->send()
set your server mail details in .env file then
run a command php artisan publish
send mail like Mail::to($user)->send(new UserRegister());
and your UserRegister class in app/Mail have one method
public function build()
{
return $this->subject("Welcome to My site")
->view('`vendor.notifications.register`',compact(''));
}
And You can set all message body in resourse/view/vendor/notifications/register
see more on laravel mail
I'm trying to set up a contact form for a client who wish to link the data from the form into their Goldmine system.
There is a 3rd party company who have sent me a sample contact form and a sample PHPMailer script, but when I test this script on the client's website it sends out the email, but as an attachment rather than in the body of the email.
I've looked at the PHPMailer script and I cannot see anywhere that references adding attachments so I'm puzzled as to whether there is something in the PHPMailer script I've not seen, or if this is some sort of server setting when the email is being sent? Any help would be appreciated.
The PHPMailer script has $Body which it just keeps adding each part of the form input to and then finally ends with what looks like the relevant bit of code to send the email:
ini_set("SMTP", Decode($SMTP));
if(mail(Decode($SendToEmail), $ToSubject, $Body, "From: GoldMine WebImport <no-reply#xxxxxxx>\r\nContent-Type: text/x-gm-impdata\r\n" )) {
print "Your data has been recorded successfully!\n\n<!--\n".Decode($SendToEmail)."\n".$ToSubject."\n".$Body."\n\n".$OutputAs."\n\n-->";
}
else
{print("There was a mailer failure.\n\n<!--\n".$Body."\n\n-->");}
}
else
{echo "There was no form data passed.";}
EDIT: I should also mention that I've been using Tectite's Formmail system for the same client on their existing contact forms and that sends the email with the content in the main body of the email as it is supposed to. I only seem to be having this problem with PHPMailer, but I can't use Formmail for sending the right info to the Goldmine system.
I am working on laravel 4.2 and I am new with SQS queue,my code works fine also i can see my queues in aws console but it not sending mail on my email id "ibrar#whiterabbit.is". I am using mandrill for sending mail.
Mail::queue($template, $data, function($m) use ($data, $subject, $admin_email, $site_title) {
$m->from($admin_email, $site_title);
$m->to("ibrar#whiterabbit.is", "ibrar#whiterabbit.is");
$m->subject($subject);
});
I also try that code but the problem is same, after Queue::push its not come in Mail::send
Queue::push(function($job) use ($data) {
Mail::send($template, $data, function($m) use ($data, $subject, $admin_email, $site_title) {
$m->from($admin_email, $site_title);
$m->to("ibrar#whiterabbit.is", "ibrar#whiterabbit.is");
$m->subject($subject);
});
});
In my opinion SQS is a simple queuing service and i use it for that like RabbitMQ for example. You can push an E-Mail to your queue but you have to process them.
To send an E-Mail you have to use SES. AT the moment you push your Mail to your queue but you don't send it.
SES is a simple Mail system you can send your mails over smtp directly to SES witch send your mail. But its possible that i didn't understand your question correctly.
I can successfully send emails by using CakeEmail class of CakePHP.
But how can I be sure that the email is sent ?
Does a response comes when email is sent successfully?
When i take success response, I will redirect visitor to some other page.
send() method send the content array if the mail send successfully or it throws an exception.