简体   繁体   English

没有SMTP的JavaMail

[英]JavaMail without SMTP

I am using Javamail API to send notification mails from my application but , the network administrator gave me mail host as mail.mycompany.com , how to use this with in Javamail without specifiying the smtp. 我正在使用Javamail API从我的应用程序发送通知邮件,但是,网络管理员给我的邮件主机为mail.mycompany.com ,如何在Javamail中将此邮件与未指定smtp一起使用。

it is like mail.google.com instead of smtp.gmail.com 就像mail.google.com而不是smtp.gmail.com

so mine should be smtp.mycompany.com instead he gave me mail.mycompany.com 所以我应该是smtp.mycompany.com,而他给了我mail.mycompany.com

what to tell the administrator about this? 告诉管理员什么呢? I also tried to ping smtp.mycompany.com it is not pinging , it says ping request could not find the host. 我也尝试ping smtp.mycompany.com,这不是ping,它说ping请求找不到主机。 Any idea what is going on ? 知道发生了什么吗?

Note : smtp.mycompany.com is example address 注意: smtp.mycompany.com是示例地址

 props.put("mail.smtp.host", "stmp.mycompany.com");
        props.put("mail.smtp.socketFactory.port", "587");
        props.put("mail.smtp.socketFactory.class",              
        "javax.net.ssl.SSLSocketFactory");
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.port", "587");

Thanks 谢谢

If mail.mycompany.com is an SMTP server you should still use it for SMTP. 如果mail.mycompany.com是SMTP服务器,则仍应将其用于SMTP。
The name is not important here but the service which is provided by this server. 名称在这里并不重要,但是此服务器提供的服务并不重要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM