Laravel 8.x Email Simulation for Testing - laravel

I want to simulate email send/receive on a Laravel 8.x app, something like using Insomnia or Postman to test REST feature by sending to an endpoint. What I want to do is to send the email to the app, and debug the app processing the email it received, all of them running on a local VM (CentOS 8), without having to send emails using my actual account.
Not much info in the Internet, and results are usually for sending out from Laravel app. Could it be that my scenario is not possible?

if I got your requirements correctly, you could use a mail server like Mailu
run an email server on a docker container
connect your laravel app to the mail server using SFTP
send your email details to your laravel app via HTTP
process your email content or debug it in laravel
send the email to the mail server
or If you received an email in that mailbox, you can get the mails with laravel and process them.
I hope this help.

Not sure if I understand, but you can use Mailhog which is an email-testing tool with a fake SMTP server underneath. MailHog runs a super simple SMTP server that hogs outgoing emails sent to it.
All outgoing emails will be trapped by MailHog, being pretty useful in order to avoid sending emails accidentally when developing.
I've asked (and finally found a solution) in this question:
Auto boot MailHog on Ubuntu 20.04 about how to use it in a staging evironment, but running locally with no need to auto start the service is even easier.
There are tons of tutorials about how to implement MailHog and Laravel.

Related

My AWS SES account got suspended since somebody used my SMTP credentials for spamming

I have a Laravel 7 based application that lets people sign up for an event. I have used AWS for hosting the application and AWS SES for sending emails. After a couple of days of setting up this application, AWS suspended my SES service saying that somebody spamming using the sender email account I have used in the Laravel App for sending emails.
When I checked the SES dashboard I was able to see that there were 50000+ emails sent from that email address without my knowledge. I'm using SES for a long time in my other applications and never faced such an issue. This is something new for me. This is my first Laravel App and hence I'm not sure how the spammers got the SMTP credentials from my code. I'm storing SMTP credentials in the .env file and using bitbucket as the repository. It is a private repository only. One mistake I did was I accidentally pushed the .env file of the Application to the bit bucket repository but which is a private repo.
Does anybody have similar experiences with Laravel and SES? Anybody got a hint of what I'm doing wrong here?
I later realised that I have accidentally stored a copy in the .env file. I removed it from there and it resolved the issue.

Sending emails with GAE and Ruby

How can I send emails from a Ruby/Rails app using GAE Mail API? I see documentation for Python/Java/Go/PHP, but nothing for Ruby.
The documentation you saw is only for the standard environment. Sending emails natively (i.e. using the GAE infrastructure) is not supported for those languages in the flexible environment either. From the Mail section of the Migrating Services from the Standard Environment to the Flexible Environment guide:
The App Engine Mail service is not available outside the standard
environment. You will need to use a third-party mail provider such as
SendGrid, Mailgun, or Mailjet to send email. All of
these services offer APIs to send email from applications running
anywhere.
The following guides show how to use these services with the flexible
environment:
Sending emails with SendGrid
Sending emails with Mailgun
Sending emails with Mailjet
So similarly you'd have to use one of those third party services. The referenced guides include Ruby examples.

Sending emails via gmail, Laravel

can anyone know if there is any difference in sending emails via gmail in Laravel 5.5 on localhost and on global server, because on localhost everything works fine, emails are sent without problem but on global server all the time crashes my authentication error go on configuration connection does not change. Of course, I have enabled mail access for less secure applications. I wonder if it's a problem with mail or a change of environment, from local to global, or something else must change in the .env file configuration or directly in the application. Thank you in advance for your help
Yes. Possibly it occurred because of app environment. Try keeping debugging on. And trace back the authentication error. Try sending dummy email with simple text.
And after making changes in env file empty config caches using php artisan cache:clear. Many times config doesn't change because of caching.
Good Luck!

Send email to external server using xampp localhost without any external SMTP

I want to send emails from my Pc(Localhost) to external servers like gmail,hotmail or yahoomail.
There are option to send email using Gmail/Yahoomail SMTP settings but i do not want to use any SMTP setting because of there daily limits.
And we also do not want to buy any email/newsletter services.
We want to create it Fully Free in our PC(Localhost).
Please tell us how can do it using Xampp and any open-source softwares.

Windows server 2008 SMTP service using for website

I am working on .net applicaton that need to send emails to clients. I am trying to figure out what would be that best solution to send emails. Here is what i have considered. Could you please suggest what would be the best way to go for?
1>Windows server 2008 in built smtp
service.
2>Exchange server hosted in our
datacenter.
3>Use google apps for sending
emails(Basically same as gmail like
for custom domain).
I have explored all options and below are findings.
1>I think would be way to go. Also
supports drop in directory to send
emails so can achieve disconnected
email activity.
2>Application would be tied up with
availability of exchange server and
we dont have any exchange server
support personal. Only developers
poke around in exchange server and
got it working. So if option 1 is as
good as 2 then would like to go with 1.
Is there any drop in directory feature in exchange server like 1?
3>Tried gmail smtp stuff didnt
work. I was receiving timeout error.
Also there is no guarantee that
gmail will send our mail
reliability. They can decide anytime
to stop sending our mails as we are
using free standard version of
google apps.
Other questions:
I installed smtp service in windows server 2008. Now to use this do i need to change any MX record and anything? What i need to do so it can send email using my domain name. Or it can send email for any domain?
I would use a hybrid of 1 and 2. Use local SMTP, but have it relay to your exchange server. Emails will queue if it can't relay to exchange and you have one server(s) that handle all of your outgoing/incoming mail. This support doc explains this setup: http://support.microsoft.com/kb/303734
You only need an MX record if you'll be receiving mail from that domain too.
I would also put in a reverse DNS entry for your domain, which will help with spam detection.

Resources