Note that there are some explanatory texts on larger screens.

plurals
  1. POImplementing mailing properly in my java application
    primarykey
    data
    text
    <p>I am trying to implement mailing system within my java application and I am not sure how send the emails so that they are respected by the mail servers and their spam filters. I will be sending emails with "finish your registration", "forgotten password" and notifications which happen within the user's account.</p> <p>At the moment I am sending the emails normally via my gmail account (I don't necessarily need to use gmail). However after a few sent mails, I get to point that gmail stops delivering my mails unless I log in into the gmail web application. I send it via classic Java mail API:</p> <pre><code>// settings properties = System.getProperties(); properties.put("mail.smtp.host", smtpServer); properties.put("mail.smtp.port", smtpPort); properties.put("mail.smtp.socketFactory.port", smtpPort); properties.put("mail.smtp.socketFactory.class", SSLSocketFactory.class.getName()); properties.put("mail.smtp.auth", "true"); // sending email via smtp Session session = Session.getInstance(properties, authenticator); final MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); message.setSubject(subject, "UTF-8"); message.setContent(content, "text/html; charset=UTF-8"); Transport.send(message); </code></pre> <p>So do I have to use my own SMTP server? What about the default sendmail linux command, why would I need SMTP? From PHP we can send email directly without SMTP, can I achieve this with Java as well?</p> <pre><code>&lt;?php mail($to, $subject, $message, $headers); ?&gt; </code></pre> <p>Which of these techniques is the most correct? How to use these services so that they are trustful to others? What can I do to be not marked as spam? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload