java发送gmail邮件_如何安排在Gmail中发送电子邮件

java发送gmail邮件

java发送gmail邮件

Gmail's web, iPhone, and iPad apps
Alexey Boldin/Shutterstock 阿列克谢·博尔丁/快门

Gmail now lets you write an email and schedule a sending time. Schedule an email for later, and it will go out at the specific date and time you choose. It’s particularly convenient for replying to emails outside business hours.

Gmail现在使您可以编写电子邮件并安排发送时间。 安排一封电子邮件供以后使用,它将在您选择的特定日期和时间发送出去。 在工作时间以外回复电子邮件特别方便。

Google added this feature in April 2019. Scheduling emails previously required a third-party extension like Boomerang. It’s now built into both Gmail’s website and the Gmail app. You can have up to 100 scheduled emails at a time.

Google在2019年4月添加了此功能 。安排电子邮件之前需要第三方扩展程序(如Boomerang) 。 现在,它已内置到Gmail的网站和Gmail应用程序中。 您一次最多可以安排100封电子邮件。

如何在桌面上安排电子邮件 (How to Schedule an Email on Desktop)

In the Gmail website in desktop browsers, compose your email regularly. Instead of clicking the usual Send button, click the down arrow to the right of the Send button and then click “Schedule Send.”

在桌面浏览器的Gmail网站中,定期撰写电子邮件。 不用单击通常的“发送”按钮,而是单击“发送”按钮右侧的向下箭头,然后单击“计划发送”。

Schedule Send button in Gmail on the desktop version of Chrome

Tell Gmail when you want to send the email. You can pick a time like “tomorrow morning” or provide a custom date and time.

在您要发送电子邮件时告诉Gmail。 您可以选择“明天早上”之类的时间,也可以提供自定义日期和时间。

You can even schedule an email for a few years out. Perhaps you want to send a message to your future self a few years from now! Gmail will let you schedule emails up to the year 2068. If Gmail is still around in 48 years and Google hasn’t changed the way this feature works, Gmail will send the email to your desired recipient—assuming they still have that email address.

您甚至可以安排几年的电子邮件。 也许您想在几年后向自己的未来发送信息! Gmail可以让您安排到2068年的电子邮件。如果Gmail仍然存在48年,并且Google并未更改此功能的工作方式,则Gmail会将电子邮件发送给您想要的收件人-假设他们仍然拥有该电子邮件地址。

Choosing a time to send an email with Gmail

如何在iPhone或Android上安排电子邮件 (How to Schedule an Email on iPhone or Android)

In the Gmail app for iPhone or Android, compose your email normally. Instead of tapping the “Send” button, tap the menu button at the top right corner of the screen and then tap “Schedule Send.”

在适用于iPhone或Android的Gmail应用中,正常编写电子邮件。 不用点击“发送”按钮,而是点击屏幕右上角的菜单按钮,然后点击“计划发送”。

Schedule Send option in Gmail for iPhone

Choose the date and time you want Gmail to send the email. As on desktop, you can choose an option like “tomorrow morning” or pick a specific date and time.

选择您希望Gmail发送电子邮件的日期和时间。 在台式机上,您可以选择“明天早晨”之类的选项,也可以选择特定的日期和时间。

Email time and date chooser in Gmail for iPhone

如何在桌面上取消预定的电子邮件 (How to Cancel a Scheduled Email on Desktop)

You can view your scheduled emails by clicking “Scheduled” in the left pane of the Gmail interface on your computer.

您可以通过在计算机上Gmail界面的左窗格中单击“计划的”来查看计划的电子邮件。

Option to view Scheduled emails in Gmail for web

Open the scheduled email that you want to stop.

打开您要停止的计划的电子邮件。

List of scheduled emails in Gmail on Google Chrome

To cancel sending the email, click “Cancel Send” at the top right corner of the email.

要取消发送电子邮件,请单击电子邮件右上角的“取消发送”。

Option to cancel sending a scheduled email in Gmail for Chrome

Gmail will revert the message to a draft. You can modify its contents and re-schedule the email or send it immediately. If you don’t want to send the email, you can delete the draft or save it for later.

Gmail会将邮件还原为草稿。 您可以修改其内容并重新安排电子邮件或立即发送。 如果您不想发送电子邮件,则可以删除草稿或将其保存以备后用。

Scheduled email canceled message in Gmail on the web

如何在iPhone或Android上取消预定的电子邮件 (How to Cancel a Scheduled Email on iPhone or Android)

In the Gmail app for iPhone or Android, tap the menu button at the top left corner of the screen and then tap “Scheduled” in the sidebar menu.

在适用于iPhone或Android的Gmail应用中,点击屏幕左上角的菜单按钮,然后点击侧边栏菜单中的“预定”。

Option to view scheduled emails in Gmail for iPhone

Tap the scheduled email you want to cancel.

点击您要取消的预定电子邮件。

List of scheduled emails in Gmail on iOS

As on desktop,  tap “Cancel Send” at the top right corner of the email to cancel sending it.

在台式机上,点击电子邮件右上角的“取消发送”以取消发送。

Cancel send option for a schedule email in Gmail on iPhone

Gmail will revert the email to a draft. You won’t lose the email unless you choose to discard the draft.

Gmail会将电子邮件还原为草稿。 除非您选择放弃草稿,否则您不会丢失电子邮件。

Microsoft Outlook will only send scheduled emails when you have the Outlook desktop program open. Gmail is smarter. It will send your scheduled email messages at the time you chose even if you don’t have the Gmail website or app open.

仅当您打开Outlook桌面程序时,Microsoft Outlook才会发送计划的电子邮件 。 Gmail更智能。 即使您没有打开Gmail网站或应用程序,它也会在您选择的时间发送预定的电子邮件。

翻译自: https://www.howtogeek.com/413377/how-to-schedule-sending-an-email-in-gmail/

java发送gmail邮件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
发送企业邮箱,可以使用Java Mail API。以下是一个简单的示例代码,您可以使用它来发送邮件。 ```java import java.util.Properties; import javax.mail.*; import javax.mail.internet.*; public class SendEmail { public static void main(String[] args) { String to = "recipient@example.com"; // 收件人电子邮箱 String from = "sender@example.com"; // 发件人电子邮箱 String password = "yourpassword"; // 发件人邮箱密码 // 指定发送邮件的主机为 smtp.qq.com String host = "smtp.qq.com"; // 获取系统属性 Properties properties = System.getProperties(); // 设置邮件服务器 properties.setProperty("mail.smtp.host", host); properties.setProperty("mail.smtp.auth", "true"); // 获取默认的 Session 对象 Session session = Session.getDefaultInstance(properties, new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(from, password); } }); try { // 创建默认的 MimeMessage 对象 MimeMessage message = new MimeMessage(session); // 设置 From: 头部头字段 message.setFrom(new InternetAddress(from)); // 设置 To: 头部头字段 message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); // 设置主题 message.setSubject("测试邮件"); // 设置消息体 message.setText("这是一封测试邮件。"); // 发送消息 Transport.send(message); System.out.println("邮件已经发送。"); } catch (MessagingException mex) { mex.printStackTrace(); } } } ``` 请注意,您需要将以下变量替换为您的实际值: - to:收件人的电子邮件地址 - from:发件人的电子邮件地址 - password:发件人的电子邮件密码 - host:SMTP服务器主机名(例如,如果您使用Gmail,则为“smtp.gmail.com”) 此外,请确保在运行此代码之前,在您的计算机上安装了Java Mail API。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值