How to sync Laravel Application with Email Server - php

I am trying to Create a Mail Box for each user and each user account will be connected to his email(Gmail, Outlook, etc). Now I am trying to connect email in real-time whenever they receive an email they also get in their mailbox. I can get receive the email through IMAP but it is not real-time I have to look for a new email after a specific time. I am looking for a package or library that can do it easily for me or any other solution. After searching I get only one solution which is IMAP and I also implemented it but now I need another solution that fits exactly. If anyone has any idea pls share. and what if I set up my own custom email server with a custom domain so how can I create such functionality with Laravel.
Why I am doing all this?
beceause I want this real time when ever user receive email his ticket will be created on behalf of email it does not need to wait until IMAP fetch and then ticket will be created or displayed.
Thanks in advance.

You do not really have any other option besides IMAP, unless you want to pair with specific services like Exchange Web Services.
PHP has a very comprehensive set of functions regarding IMAP. I would suggest checking it out. Unfortunately, there is not really anything you can do from within PHP to prevent having to poll.
My suggestion is checking in the background if new mails have arrived. For example by checking from within a cronjob. That way you don't have to initiate a new connection to an IMAP server every time a users visits the page.
IMAP docs

Related

sending mail using Amazon SES and display stats of mail using Laravel 5.4

I want to setup SES for sending mails in bulk using Laravel 5.4 and I want to see it's stats like soft bounce, hard bounce, clicks, opens, etc information and display this information in my admin panel.
I read some docs of amazon and it's not up to mark so can anyone please help me to get nice tutorial which fulfils my needs above mentioned
Thank you so much in advance!
You can try out Aws API to get status of your email being send.
And if you want to get bounce and complaints you can create a API from your side and add those in AWS panel by creating topics and also you have to verify these, or else there are other methods described in AWS Dashboard.
https://aws.amazon.com/blogs/messaging-and-targeting/handling-bounces-and-complaints/

Basic Node.js app on Heroku - free way to send emails?

I am making a basic web app on Heroku and want to be able to send basic emails. I am coming from PHP but trying to write this one in node.js. I am used to PHPMailer. I have a gmail account that I want to send a certain email from every time a certain page is accessed. Nodemailer and postmark all seem to have costs associated - is there a 100% free option that I could use to send from Gmail? Else I may just do this in PHP.
Thank you
Add a POST endpoint to your Node router to submit the data to be used to create a message and use a library with support for SMTP with TLS/SSL security like emailjs to send standard SMTP emails via accounts like Gmail (you will need to enable third party apps in the security settings for the Gmail account). There is likely more than one library option but I am recommending one that I've used for a few years myself:
emailjs Lib for Node
https://www.mailgun.com/ is a service similar to postmark. They provide a simple REST API to send email and their free plan allow you to send 10,000 emails per month. Depending on the volume you want to send, this can be a viable solution for you.

Check for Event Daily, and Send Notification Messages

What is the best way to set up a system that checks for events daily and sends messages via email, Twitter, SMS, and possibly Facebook? Keep in mind, that I do not have access to a web server with root access (Using Rackspace Cloud). Would PHP have a solution for this? Would there be any drawbacks to using Google App Engine and Python?
If you are using Google App Engine with Python you could use "Cron" to schedule a task to automatically run each day.
GAE also allows you to send emails, just a little tip: make sure that you 'invite' the email address used to send mail to the application as an administrator so that you can programatically send emails etc.

Trigger PHP Script on New Email (Google Apps / Gmail)

Is there any way to trigger a php script when a new email arrives on Google Apps (Gmail)? I've figured out a way to poll the inbox to look for new messages, but I'd ideally like a more event-based solution. Basically I need it to be run from a server somewhere which would parse new email messages and process itself according to the contents of the message.
Most mail transfer agents let you put in filters that can process incoming mail through a program as it arrives. SpamAssassin works this way, for example.
Because Gmail is hosted, you can't exactly do that.
The only realistic answer in this case is polling. Thankfully Gmail exposes both POP3 and IMAP access, so checking should be very simple. There are a few comprehensive mail reading libraries out there, or you could be insane and poke at IMAP directly.
Edit: Because you're on Google Apps, there's also an Atom feed of unread messages, though you'd still need something to poll the feed, unless you happen to have something handy that will do the polling for you and fire up requests. I vaguely recall something like this existing, but I don't recall what it's called...
It's possible now, using Google Apps Scripts. You have to create a script and attach a trigger to it to run every 1 minute or so. If a new email is found, just invoke your URL.

Sending forgot password emails

I am building a service that will have a 'forgot my password' feature. In addition to that, it will also email users when results are ready from my service.
I would like to ensure delivery of my emails so I was looking around to find a service that would let me send emails.
All that I've been able to find so far are services that require a user to opt-in to a list.
In other words, I've been unable to find any that will let me send customized messages to individual users.
I am currently using swiftmailer for php but would really like to find a service to do this...Anyone know of one?
Edit1: It's not that I don't like swiftmailer but more that I want to make sure I do not have my emails end up getting blocked by spam filters. Also, it would be easier to rely on a service that already has the stuff setup that Atwood talked about in that article.
A very low volume solution that I use, and by low volume, I mean under twenty pieces per day, is to setup a GMail account and send your messages from that account. There are plenty of very simple programmatic solutions for this. Just Google for "php gmail send" and take your pick!

Categories