How to get read receipts in Codeigniter Using GMail SMTP? - codeigniter

I want to add read receipts function on email send using GMail smtp in Codeigniter. How can I do that? I searched in google and it's only have for pure PHP Mail Function and PHPMailer. But i don't want to use phpmailer plugin. So help me to do with Codeigniter Mail function. Thanks.

you can use the CodeIgniter function to add some extra header in your email:
with Read-Receipt-To: , X-Confirm-reading-to: or Disposition-Notification-To: headers and you put your email or your compagny name followed by your email for the value.
The fonction is $this->email->set_header($header, $value);
But be careful, it doesn't works everytime because of web services security boxes, sometimes they don't let these headers to return to the value's email adress put.

Related

Laravel Mail - Use special character in Sender's Name

I use Laravel 5.8.
And what I'm trying to do is to send an email with sender's name which contain special character such as TheTh#nos. And it is not working. The email was sent, but the sender's name will not displayed.
This is my code:
Mail::send('emails.purchase-token', $data, function($message){
$message->from('noreply#thetanos.com', 'TheTh#nos');
$message->subject('New Tokens Have Been Added To Your Wallet');
$message->to("recipient01#gmail.com);
});
I'm pretty sure this is because of how gmail (and most modern e-mail clients) work.
When you put a # symbol in the From header field, the email client thinks that you're attempting to spoof the mail to make it look like it originated from a different e-mail address, even though TheTh#nos isn't a valid e-mail address.
Try using other special characters in your from and see if that works.
Also, some hosting providers doesn't allow you to change the From header when using their SMTP server.

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

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.

Laravel 5.7 Email Verification Link Broken

At the moment I'm trying to implement the Laravel 5.7 email verification. I have got it so a mail driver will send an email out when registering a user. However, when I click on the email verify button, I get a 404 error.
The URL it sends me is this:
http://localhost/email/verify/16?expires=1543926629&signature=fa3a2a0d90c5752f99b24a7cf7c789edadba5aad2922fff907c289b3364ebceb
However, it is using the wrong URL as the local APP_URL in the regular .env is not localhost. Does anyone know how I can tell the email verification to use APP_URL instead of localhost? When I rename the URL to the correct URL, I can complete the email verification. Thanks.
Verify in your Http\Controllers\Auth\VerificationController.php if the protected attribute $redirectTo value exist in your routes\web.php or can be handled.

Write a serveice class for send mail

I want to write a class for send mail with sendgrid on Laravel 5.1
I want to know better way to implement mail send function in Laravel.
I thought to create a serviceProvider. Is there any other suggestion for make better ?
Thanks in advance.
You can just use the Sendgrid SMTP server, as shown in their Laravel integration documentation.
Just edit your .env file like that:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_USERNAME=your Sendgrid username
MAIL_PASSWORD=your Sendgrid password
Then you can use Mail::send() just like you normally would.

Laravel 4 sending mails with plain php mail function

In a few tutorials I have read that you can send emails with plain php mail() function. If I configure it with driver as 'mail'. I do not receive any mail in my inbox of my google mail account, but I configured it to receiver = googlemail-account.
Instead of sending mails they will collected in
{ROOT_LARAVEL_FOLDER}/mailoutput/mail_{timestamp}.txt.
Can you give me an advise to solve that problem?

Resources