Category : swiftmailer

There is no problem on the local server, everything works. Mail’s is can sendable, when I deploy my website to GoDaddy I got this error: Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 (Network is unreachable) My .env is; MAIL_MAILER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=2021365. MAIL_ENCRYPTION=tls [email protected] MAIL_FROM_NAME="${APP_NAME}" Sourc..

Read more

i am trying to send email using laravel swiftmailer & using smtp.gmail.com my php.ini ssl connection is open already but still get these errors my .env file code MAIL_DRIVER=mail MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=example123 MAIL_ENCRYPTION=tsl Error # 1 (when using MAIL_ENCRYPTION=tsl) Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tsl://smtp.gmail.com:587 (Unable ..

Read more

I have the need to send mail campaigns with around 100k mails as fast as possible. The listener which processes emails is nothing special: public function handle(object $event) { $message = EmailMessage::query()->findOrFail($event->messageId); $recipients = $message->recipients; $this->sendEmail($message, $recipients); $this->updateStatus($message); } protected function sendEmail(EmailMessage $message, Collection $recipientCollection): void { $queuedEmail = new QueuedEmail($message->subject, $message->body, $message->conversation_uuid); $to = ..

Read more

When trying to send mail to mail address which has non-ascii (non-Latin, utf8) characters in it’s local part, I am facing an error which comes from Swift_AddressEncoder_IdnAddressEncoder class, function encodeString and it looks like this Non-ASCII characters not supported in local-part. I have made a class which extends Mailable: class ExtMailable extends Mailable { use ..

Read more

I try to send email to user using templates. So,before the email sent it should check that the user received email on that day or not. It’s like One user should received one mail only in a day so i add if statement which is if (EmailSave::where(‘user_id’,$user_id)->whereDate(‘created_at’, Carbon::today())->exists()) { after i add this line the ..

Read more

Here’s the SwiftMailer plugin sample code, but it didn’t use the laravel mailble. $decorator = new Swift_Plugins_DecoratorPlugin($replacements); $mailer->registerPlugin($decorator); $message = (new Swift_Message()) ->setSubject(‘Important notice for {username}’) ->setBody( “Hello {username}, you requested to reset your password.n” . “Please visit https://example.com/pwreset and use the reset code {resetcode} to set a new password.” ); Source: Laravel Sta..

Read more

I tried to set up a connection to my mailserver with Laravel/Swiftmailer. The Mailing section of my .env looks as follows: MAIL_DRIVER=smtp MAIL_HOST=<THE MAILHOST> MAIL_PORT=465 MAIL_USERNAME=<THE USERNAME> MAIL_PASSWORD=<THE PASSWORD> MAIL_ENCRYPTION=ssl Personal information is censored for obvious reasons, but the configuration does work. I tested it by connecting to the server with this configuration with thunderbird ..

Read more