I develop a application on android to send email. I want to use account MSN to send mail but it not send and error code on debug as below:
My configure on property are:
systemProperty.put("mail.smtp.starttls.enable","true");
systemProperty.put("mail.smtp.auth", "true");
systemProperty.setProperty("mail.host", "smtp.live.com");
systemProperty.put("mail.smtp.port", "587");
The password and email address are correct and i ever test with other host are work except MSN.
It looks like JavaMail isn't able to figure out your host name correctly, although I don't know why it would think "????" is your host name. Set the mail.smtp.localhost property to the correct host name for your machine. See the javadocs for the com.sun.mail.smtp package for details.
There seems nothing wrong with your configuration. 501 5.5.4 Invalid Address can be occuring because of the possible reasons below
The To email address is wrong in format (like check if it violates the possible combinations of email addresses. Eg., "My Name" - try simplifying it to myname#live.com and try
It might be bouncing email address
Check the library you use for sending this, how and what it allows
Related
evening,
i'm trying to do my own email client and then error came.
im using javax.mail library
i did try several methods for sending, most of them crash on sad places. anyway, one method i consider with potential is fine until end when message pops up:
m02 error-2: javax.mail.AuthenticationFailedException: 535 5.7.8 Error: authentication failed: Your message looks like spam. You need to use web for sending or prove you are not a robot using the following link http://ya.cc/[deleted] where [deleted] is originally few letters string.
i saw with gmail, you need to set something in settings to be able to use your own client, i expected this would be similar case but i couldn't find any settings about it in yandex mailbox settings.
another point, smtp address i have found at some forum so i presume it is possible to use own client
properties i set:
properties.put("mail.smtp.host", host);
properties.put("mail.smtp.socketFactory.port", port_ssl);
properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
properties.put("mail.smtp.auth", "true");
properties.put("mail.smtp.port", port_ssl);
where
private String host = "smtp.yandex.com";
private String port_ssl = "465";
other code, im using classic way: Session for Authenticator, then Message and Transport.send. anyway, i think problem is with properties or mailbox settins? i just cant think of where.
question: how can i fix it so i can send an email with my client?
note: reason for using yandex is thanks to simple sign up since i dont have phone number and gmail requires one. if you know about other email service where own client should work & no need for phone that is also nice alternative answer
As an alternative answer, you could try the service https://protonmail.com, it should not require phone number and it can be reachable by SMTP clients using these settings https://mailsettings.co/protonmail-smtp-server-settings
I am new in BIM Server , trying to figure out how BIM server and IFC model sync together.
I made connectivity to local BIM-server from a java application. I use the default settings as described in https://github.com/opensourceBIM/BIMserver/wiki/Setup .
Now, when I am going to create a new user it only ask for mail address , username and Access level. No password field . So, I can not do log in using that user.
"Send Password Reset" is giving the following error :
" Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused: connect) " .
Whether it is a BIM server version problem or I am missing something ?
I have not found any well prepared Documentation or tutorial on BIM server. My goal is to check how the BIM server can replace the ftp server that we are using now to store IFC files.
Thanks in advance
-Nazar-E-Bukhari
I have posted this in BIM server Issues. I am posting the answer if someone is also searching for the same solution.
"It's really bad practice to have an administrator set the user's passwords. How is the administrator going to give the passwords to those users? (I agree with him, but as because I am testing it in my localhost, I have no mail server configured)
Setup a working e-mail server, or better yet, use a third party's server. For example have a look at mailgun, sendgrid or postmark."
We use a GlassFish server (JavaEE 7) with JavaMail.
Afaik, the official E-Mail RFC states that mail addresses may look something like this:
Tom Tester <tom.tester#test.com>
which would include a nicer representation than using only the email address. The Glassfish server is able to use this when configuring it on the admin console, clients like the GMail web client then display "Tom Tester" as sender. However, I'd like to specify the mail resource in the glassfish-resources.xml within our project, the configuration file doesn't allow < or >, because it's xml. I tried
<mail-resource
from="Tom Tester <tom.tester#test.com>"
...
and
<mail-resource
from="Tom Tester tom.tester#test.com"
...
, but these configurations won't work. Both approaches end up in sending only "tom.tester#test.com" as sender. I also didn't find any specification details from the GlassFish docs. Does somebody know if the desired behaviour is possible?
In case you want to explicitly set the personal name for the sender, you need to do it while creating the email message.
Let's say you have the session mailSession from the GlassFish Resource and you are creating a message mailMessage
Now you can set the from attribute of the message:
mailMessage.setFrom(new InternetAddress(mailSession.getProperty("mail.from"), "Tom Tester"));
Read more here.
I am using :
transport.connect(getHost(), getPort(), getUsername(), getPassword());
to send email, but it always gives me the following exception:
class com.sun.mail.smtp.SMTPAddressFailedException: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.
But actually I have provided the username and password above, and the username and password is right as I tested in thunderbird, it can send email well.
So what's my problem ? Please point me the right direction. Thanks
When creating the javax.mail.Session, be sure the given properties contain:
props.put("mail.smtp.auth", "true");
http://www.oracle.com/technetwork/java/javamail/faq/index.html#smtpauth
I think that you need to talk to the administrators of the mail server to see what is going on. You might be using the wrong port for instance. Or there might be some local policy that you need to observe ...
I have currently face a problem when I try to send an email using JavaMail API. The exception I get from my application console is :
"javax.mail.MessagingException: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)"
by the way, I have already set my mail.smtp.auth property to true as : props.put("mail.smtp.auth", "true"), but it still fail, does anyone has idea? or face similar problem before ?
A 550 error is often returned by the SMTP server when the sending hostname cannot be inverse resolved to the originating IP address. This allows mail servers a bit of authentication that the sending client is who it says it is. Unfortunately, many test clients - especially systems behind a NAT device - will have originating IP addresses that don't map to any name.
For example, the machine I am typing this on has an unroutable IP address of 192.168.1.103 and my hostname could be so.example.myhouse which works fine because my router pretends that packets from my desk come from (e.g.) 69.59.196.211 which is my WAN address. However, if you use a props.put("mail.from", "me#so.example.myhouse") the SMTP server may try a DNS lookup and obviously fail for my fictional hostname (that is, one that the global DNS doesn't know of).
Even if I used the DNS name which maps to 69.59.196.211 (e.g. stackoverflow.com) the SMTP server may do a reverse DNS lookup to check that 211.196.59.69.in-addr.arpa maps to stackoverflow.com. If that fails, the SMTP server may consider you a spoofer and return a 550.
Finally, your sending client or every host it its IP address block could be blacklisted by the SMTP server for reasons that you have no control over.
Without more context than you probably want to post (names and addresses of the guilty client and server) I can't be sure that it is an SMTP/DNS problem unrelated to Java so you'll have to check those bits yourself. You can skip the Java altogether and telnet smtp-servername 25 and talk to the server yourself. You'll find RFC 2821 helpful should you try.
replace
props.put("mail.smtp.auth", true);
to
props.put("mail.smtp.auth", "true");
and it works :)