当gmail访问被阻止时,是否可以使用Java发送邮件

时间:2022-02-20 18:13:32

I have working code to send mail using gmail smtp. It's working on my machine, but when I'm trying to run same code from my office system, then it showing error Unable to Connect SMTP Server. So, I was wondering, is it possible to send mail by bye-passing local/office network ? Any work-around ?

我有工作代码使用gmail smtp发送邮件。它在我的机器上运行,但是当我尝试从我的办公室系统运行相同的代码时,它显示错误无法连接SMTP服务器。所以,我想知道,是否有可能通过旁路本地/办公室网络发送邮件?任何解决方法?

PS: I can't use my corporate email address, since it's internal task.

PS:我不能使用我的公司电子邮件地址,因为这是内部任务。

1 个解决方案

#1


0  

What you need to do is install a mail server on your machine and use that mail server to send emails. There are a lot of opensource and/or free options available. I have used hMailServer in the past (on Windows7), and it seemed to work for me, just the way I wanted it to. One possible downside of using this approach is that your emails may sometimes end up in the spam folders of your intended recipients.

您需要做的是在您的计算机上安装邮件服务器并使用该邮件服务器发送电子邮件。有很多开源和/或免费选项可供选择。我过去曾经使用过hMailServer(在Windows7上),它似乎对我有用,就像我想要的那样。使用此方法的一个可能的缺点是,您的电子邮件有时可能最终会出现在您的目标收件人的垃圾邮件文件夹中。

However, you will need Administrator privileges to install most mailservers.

但是,您需要管理员权限才能安装大多数邮件服务器。

#1


0  

What you need to do is install a mail server on your machine and use that mail server to send emails. There are a lot of opensource and/or free options available. I have used hMailServer in the past (on Windows7), and it seemed to work for me, just the way I wanted it to. One possible downside of using this approach is that your emails may sometimes end up in the spam folders of your intended recipients.

您需要做的是在您的计算机上安装邮件服务器并使用该邮件服务器发送电子邮件。有很多开源和/或免费选项可供选择。我过去曾经使用过hMailServer(在Windows7上),它似乎对我有用,就像我想要的那样。使用此方法的一个可能的缺点是,您的电子邮件有时可能最终会出现在您的目标收件人的垃圾邮件文件夹中。

However, you will need Administrator privileges to install most mailservers.

但是,您需要管理员权限才能安装大多数邮件服务器。