I'm trying to send emails via Javamail to a corporate account. My Java test app works fine when I send message to gmail and my personal email. I can also successfully send to the corporate account via my email hosting webmail client.
I've read through posts here and have tried setting -Djava.net.preferIPv4Stack=true in the VM for the test app but it did not work.
I have checked the junk mail at the corporate client and the message is not there. That is not to say its not being blocked elsewhere at the corporate site.
Any ideas what can be causing this problem?
I'm using org.apache.commons.mail.HmtlEmail and this is the test code:
// Create the email message
HtmlEmail email = new HtmlEmail();
email.setHostName(smtpHost);
email.setAuthenticator(new DefaultAuthenticator(smtpUser, smtpPwd));
email.setSSLOnConnect(true);
email.addTo(to);
email.setFrom(from);
email.setSubject(subject);
// set the html message
email.setHtmlMsg(text);
// set the alternative message
email.setTextMsg("Your email client does not support HTML messages");
// send the email
email.send();
So #Bill's question regarding Javamail debug output got me thinking about the content of the email message. The debug log shows all is fine but what I found was I included Bootstrap and Fontawsome JS / CSS links in the email header and that caused the message to be rejected by the corporate system for security reasons presumably. Thanks for the help
Related
I am performing some tests on my Nopcommerce site that should allow the user to type a message in to the contact box of the site and that message should be sent by email to a user.
When setting up and testing said user on the site, I am able to perform an email test against an internal email address and this works fine, I receive the email. However, if I try and send the email to an external email address, such as hotmail etc, I receive no error logs at all.
Has anyone ever come across this issue when trying to set up an email on a Nopcommerce site?
I am using port 25 however I have tried to use port 587 with no luck
The answer was that the username and password no longer existed for the server I was sending mail from. Moreover, another issue I had was that the mail still wasn't sending and was sitting in the Message queue. To overcome this I had to make sure that the bindings for the site on IIS were identical to the host values on the site. Doing this allowed me to send mail.
Right now, i am able to send my email to current host where i have declared in the scala code application.conf
smtp.host=apps.hubino.com, smtp.port=25
but i am unable to send my mail to other host like gmail and yahoo. Can anyone help me how to achieve sending mails to every host in scala.
I am sending email through google smtp server with these configuration.
smtp.host=smtp.gmail.com
smtp.port=465
smtp.ssl=yes
smtp.user=“********#gmail.com"
smtp.password=“**********"
This should work. Also if you make small changes in host and port you should be able to send email to any other smtp servers.
Which scala plugin you are using to send email? You can check MailerPlugin of Play or Courier plugin. Both are very simple to use.
And first time google will block sending email through you application as it is less secured so you need to make changes in your gmail account settings to allow sending email through less secure clients. This link can help you do that or else if you try to send email without making these setting you will received email from google saying securing 'Blocked sign-in attempt' which will contain URL to make changes in your account setting to allow sending email through api client.
I am trying to send an email verificaton for my site from a server other than gmail.ie support#example.com . But it is not working, and it works for gmail account,
here is my configuration settings:
mail.smtp.user="support#example.com"
mail.smtp.starttls.enable="true"
mail.transport.protocol="smtps"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
mail.smtp.host=mail.example.com
mail.smtp.auth=true
mail.smtp.socketFactory.port=465
mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback=false
mail.login.username=support#example.com
mail.login.password=pasword.
Did i miss anything??
Hi this seems to work fine. Check the connection and U may have to change the security settings of the 'from mail account' manually to allow sending from code. Then the mail will be sent correctly and the receiver may be getting it as a spam mail.
I'm developing a web application that uses javamail to send email messages and it works correctly.
The problem is that I don't get the email that I'm sending in the sent mail folder in the gmail account which I connect to, also I don't get bounced email as it happens if I try to send the email via gmail application.
I doubt this is due to security restrictions from javamail and cannot be done, as it would be much faster to get a possible spam list from an email server than doing it manually.but if it's for security reasons it would just be much better just not to bounce emails.
How can I use javamail as if sending the mails from gmail.com, getting the sent message in the sent mail folder and bounced mails in inbox folder?
The problem is that I don't get the email that I'm sending in the sent mail folder
Sending a mail via SMTP does not copy it to a sent folder automatically. Your sending application would have to make an IMAP connection after the SMTP connection and copy the message into the sent folder.
also I don't get bounced email
Make sure the Evelope Sender Address ("Return-Path") is set to the Gmail Adress you're using to send the messages.
I am wondering if any email recipients may have automatically marked incoming messages as spam, only because swiftmailer was used to send the message (via google smtp, real google account)
Any info on this?
I have been using swift mailer with a gmail account to test sending emails with my web application.
Everything seems to be fine as SwiftMailer sets up the headers properly and none of my emails have ever gone into the spam folder.
When sending multipart emails, swift mailer does insert something into the headers:
multipart/alternative; boundary="_=_swift_v4_13311823894f583b352a1eb_=_
So, yes it is possible to tell if an email is sent using swift mailer as well.