I'd like to be able to send emails to people from within a java application (for a project).
So far, I installed 1st Mail Server, then using the code (2 jars were added to classpath):
I was able to email myself, but other emails like hotmail addresses blocked the mail cause of something to do with spam.
So then I was looking at this...
Which has a year service for £14.
The point is, I dont know how I put it together... Can I just use java with this authsmtp, or do I still need a mail server like 1st Mail Server as well,
which I only have 30 days on trial, so this is not good in the long run.
Can anyone explain the process for me before I make the purchase.
Thanks for any help/advice.
I'm not familiar with the service you mentioned, but they should provide you with a username, password and server name (or IP address) of the outgoing server, all of which you'd plug into your code. That should be all that's required.
This authSmtp server is not a program I install on my pc, (like the 1st Mail Server), but is that company's actual server.
Then from java program, this sends message to their server which sends it to the intended email address.
Then I have this code...
So here I guess, under host section, I put in address of authSmtp's server,
and the last 2 will be username and password which they should provide.
I thought I would ask here first, since its java specific kind of, before I ask them anything.
Thanks, does this seem correct?
I'm not sure if the port number line is correct, I just added that.
SMTP Server : mail.authsmtp.com
SMTP Ports : 23, 26, 2525 or 25 [not usually recommended]
I figured if the default is 80, then I should specify the actual port(maybe not?).
So, I used the username and password they supplied me, and tried to send myself an email:
And I got..
Exception in thread "main" javax.mail.MessagingException: 513 5.0.0 Your email system must authenticate before sending mail.
But also, all new accounts need to be verified which can take a few hours, so perhaps thats the problem.
I'll try it later tonight and see if theres any improvement.
By the way, the default port is 80 only for HTTP; for SMTP it's 25.
Exception in thread "main" javax.mail.MessagingException: 500 5.0.0 Envelope From Address of <firstname.lastname@example.org> is not authorised - go to: http://control.authsmtp.com
But I'm trying to send from my pc, not from an email address, so I donno what to do now. ???
It was the 'email from address' that confused me, but I guess this is just the email address that the receiver sees when they get the message, and it gives them something to reply back to. I found some complete code...
I have to have this address added in the stmpServer. I'll keep you posted if I get stuck.
colin shuker wrote:I have to have this address added in the stmpServer.
Right, so the SMTP server you are using wants to make sure you aren't trying to send e-mail which appears to be from somebody else. Stealing e-mail addresses to use as "From" is a common spamming technique, so it's good that you aren't allowed to do that.