正在发送电子邮件:连接失败 [英] Sending email: failed to connect

查看:98
本文介绍了正在发送电子邮件:连接失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Java发送邮件. 我想将从邮件ID"设置为xyz@chatmeter.com. 当我将其用于发送邮件时,将生成以下异常.

I am using java to send mail. I want to set the from mail id to xyz@chatmeter.com. When i am using that for sending mail the following exception is generated..

    Exception in thread "main" javax.mail.AuthenticationFailedException: failed to connect
    at javax.mail.Service.connect(Service.java:322)
    at javax.mail.Service.connect(Service.java:172)
    at javax.mail.Service.connect(Service.java:121)
    at javax.mail.Transport.send0(Transport.java:190)
    at javax.mail.Transport.send(Transport.java:120)
    at sendmailtoclient.SendSMTP.sendMail(SendSMTP.java:125)
    at sendmailtoclient.SendSMTP.main(SendSMTP.java:153)

我已经为邮件帐户使用了正确的密码. 尽管我已经成功使用了xyz@gmail.com. 如果您有验证码,请邮寄给我.

I have used the correct password for the mail account. although it I have used the xyz@gmail.com successfully. If you have code please post to me.

请帮助我.

谢谢.

推荐答案

您的凭据似乎不正确或未被gmail接受.
您需要SMTP服务器来发送邮件.您可以使用自己计算机上安装的一个计算机

一个免费的是此处.

还要检查是否添加了activation.jar

It looks like your credentials are wrong or not accepted by gmail.
You need SMTP server for sending mail. You can use one installed on your own machine

One free one is here.

Also check if you have added activation.jar

这篇关于正在发送电子邮件:连接失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆