Sending smtp emails with SpringBoot application - linux

I have a basic SpringBoot 2.0.5.RELEASE app. Using Spring Initializer, JPA, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file.
I've configured the springboot properties as follows:
spring.mail.host=smtp.gmail.com
spring.mail.username=nunet#gmail.com
spring.mail.password=nunet999!
spring.mail.properties.mail.smtp.auth = true
spring.mail.properties.mail.smtp.socketFactory.port = 465
spring.mail.properties.mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.smtp.socketFactory.fallback = false
spring.mail.propertirs.mail.smtp.ssl.enable = true
and It is working fine when sending emails. I also have an email address from my domain info#nunet.com
I am using Postfix to forward the Emails from info#nunet.com to to nunet#gmail.com and its working fine.
I would like to know if there is a way to do it on the other way around. Send emails from info#nunet.com but using nunet#gmail.com smtp to avoid to install a Mail server.
or basically I would like to know how to extract the smtp properties from my linux server, because from there I can send emails using the command
cat ~/test_message | mail -s 'Test email subject line' nunet#gmail.com

I think you need Google Suite's email feature. With this feature You can create a custom email address using your own domain name then send & receive emails with Gmail (Gmail Suite).
After configuration working with Gmail's SMTP is same as you done before.
Read more: https://digital.com/blog/create-email-using-gmail/#ixzz5Sxusynvb

Basically this is possible with SMTP, but the most SMTP-Hoster don't allow it to avoid spammers to send spam. Furthermore the most E-Mail-Hoster will detected that kind of mails as spam.

Related

PHPMailer bounce email address shows in sender mailbox

I am using a PHP script to send emails using PHPMailer (on an ovh web server).
With the following script :
$mail->isMail();
......
$mail->addReplyTo('postmaster#mydomain.fr', 'Site');
$mail->SetFrom('postmaster#mydomain.fr', 'Site');
Emails get delivered to my gmail account BUT not to other addresses (e.g. my Business email).
With the following script :
$mail->isMail();
......
$mail->addReplyTo('postmaster#mydomain.fr', 'Site');
$mail->Sender = 'postmaster#mydomain.fr';
Emails get delivered to other addresses (e.g. my Business email) BUT not to gmail.
Also the sender appears as
bounce-id=D004=U58180. …… .net
which is not so friendly.
Is there a way to solve those issues ?
Using setFrom by itself will result in Sender being set to the same value as your from address (look at the code in the setFrom method). So in your second example you're setting the envelope sender, but not the from address, which is likely not what you want.
You may find it easier to use SMTP to localhost instead of isMail(); just changing that method to isSMTP() should be enough to do that. That way you can set SMTPDebug = 2 and see exactly what your local mail server is saying.
Separately, you don't need to set a reply-to address if it's the same as your from address – PHPMailer will simply ignore it if you try to set them to the same value anyway.

Setting up simple web application service and testing - Linux debian 10

I am doing my assignment given by the lecturer. On the title stated, my idea is about setting up a mail server on the server and we can send the email from the client, all the email is stored in the server virtual machine. Do my idea is correct on this title stated or any recommendations?
Sending mail is not that hard, especially just using (E)SMTP, tcp
text dialogs. Or you can use Linux mail commands.
Storing mail, either locally or accessing mail on a pop or imap server, poses
another set of challenges.
And of course, you need the HTML web pages as well as the services.
Attaching files can be another challenge, both uploading the files
and encoding them for inclusion in the mail.
JAVAScript can make some usual features of email clients easier, like sorting a list of emails in a folder or from a search by a column ascending or descending.
Searching email is an even bigger challenge!

Building Emailing Backend with Node js

I need to build an email backend that can receive email, send email, store them in the db, like other all email services, such as Gmail or Yahoo.
Which module should I use to build such app? I searched about this, but it's all about nodemailer, which is just a sending module.
Depends on what you actually want with the backend.
For parsing mail messages i should use a package like mailparser. It tries to parse the source in different objects. Like to, cc, bcc, attachments, body etc.
For loading the messages, you can use one of the several IMAP clients. Store them with the mysql package.
Sending ofcourse with nodemailer.
The big question stays, what is the purpose of the backend. Creating a mail backend is not a easy task. Loading from IMAP and sending by SMTP is not the problem. But if you want create a service like Gmail or Yahoo, you need think about a lot aspects, like SPAM protection, queueing of mail, throttling of the outgoing mail and a lot more.

Limesurvey notification emails will not send

I've recently noticed an issue with my Limesurvey installation. Until recently, I had a number of surveys set to email the user after submission (using {email} in the "Send detailed admin notification email" box to refer to an email question in the survey). However despite not manually changing anything, they no longer send. Some others do send from within limesurvey, for example from the "Create new admin" option, while token related emails will not.
In the case of token invitations, the debugging there will say emails sent when using php, but the test emails never arrive (multiple emails tested). When using SMTP, I get the below:
SMTP connect() failed... Some emails were not sent because the server did not accept the email(s) or some other error occured.
I should note that while I first noticed this in existing surveys in version 2.73.0, I've since done a fresh install of 3.1 and created a test survey. So this is pointing at a server config issue, but I haven't had any issues with emails sending except in this specific case.
Any suggestions of particular places to look would be much appreciated!
Did you try to change the email method in settings (https://manual.limesurvey.org/Global_settings/en#Email_settings)?
Email method: This determines how emails are being sent. The following options are available:
PHP (default value): uses internal PHP mail function
Sendmail : uses sendmail mailer
SMTP : based on SMTP relaying. Use this setting when you are running LimeSurvey on a host that is not your mail server
Make sure that you are using your SMTP configured email (Global settings -> Email settings) if you use SMTP, otherwise there might be a chance that the following error is displayed: 'SMTP -> ERROR: RCPT not accepted from server: 553 5.7.1 : Sender address rejected: not owned by user'
Qmail : Set this if you are running the Qmail mailer

Check if email exist with emailjs in node js

I'm trying to use the emailjs (https://github.com/eleith/emailjs) for sending emails in nodejs.
I want to check if email exists before sending it and I do not want to send an email to know this.
So, My question is: How to check if an email address exists on the remote server?
At the network level, receiving and sending email are different operations. In a typical email client (like outlook or a wwebmail program) they appear integrated, but that is an elaborate illusion.
Your question mentioned a npm module to use SMTP to send emails. That's the way email clients do it.
Email clients use the POP3 protocol and sometimes the IMAP protocol to read messages from mailboxes on email servers. Some npm modules handling pop3 are available for node.js, and you can use one. But you will have to create the code to "know this email exists" as you put it in your question. You will read emails from the mailbox -- all of them! -- and examine them for the information you need to "know this email exists." If the inbox you read also belongs to a person, you need to be careful to tell POP3 to leave the messages on the server.

Resources