简体   繁体   English

如何将邮件从gmail发送到mailgun?

[英]How to route mails from gmail to mailgun?

I have just started using mailgun. 我刚开始使用mailgun。 I am facing an issue. 我正面临一个问题。 Lets say my domain is test,I have done this 让我们说我的域名是测试,我已经做到了

abc@gmail.com--> support@test.mailgun.org --> myAccount@gmail.com

SO I am able to route incoming msgs coming to my gmail account, Now I want if I reply from gmail account to the particular user it should appear like that it is sent from support@test.mailgun.org. 所以我能够路由来自我的Gmail帐户的传入消息,现在我想如果我从gmail帐户回复给特定用户,它应该看起来像是从support@test.mailgun.org发送的。

myAccount@gmail.com --> abc@gmailc.com (appeared as it is sent from support@test.mailgun.org)

is it possible???? 可能吗???? Language:- Java 语言: - Java

Thanx to @Andersen, I got the solution. Thanx到@Andersen,我得到了解决方案。 In gmail we have option in which we can change our mail id and make it look like it is coming from some different id while replying. 在gmail中,我们有一个选项,我们可以在其中更改我们的邮件ID,并使其看起来像是在回复时来自某些不同的ID。

1) Go to settings in gmail 
2) Click on Accounts
3) Send mail as: Click on Add another email address you own
4) Provide the email id you wish to appear as "Sender ID"
5) provide SMTP connection details which you can see once you login to your mailgun account and click on domain.

在此输入图像描述

6) Save the settings, now when you are replying we can change from id to our custom domain id.

Enjoy 请享用

You need something to make the message leave your gmail inbox. 您需要一些东西才能使邮件离开您的Gmail收件箱。

This can either be a rule in gmail itself (been a while, do not know what forwarding rules they have at the moment) or to use a client that reads a mailbox and resend the messages. 这可以是gmail本身的规则(已经有一段时间了,不知道他们目前有什么转发规则),或者使用读取邮箱并重新发送邮件的客户端。

This is what the Unix utility fetchmail does, but you can easily use the java mail package to access gmail using IMAP and then create new messages based on these which you then send though your own SMTP server. 这就是Unix实用程序fetchmail功能,但您可以轻松地使用java邮件包使用IMAP访问gmail,然后根据这些邮件创建新邮件,然后通过您自己的SMTP服务器发送这些邮件。

If at all possible use existing code! 如果可能的话,使用现有代码! This is a bit tricky to get 100% right. 100%正确,这有点棘手。

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

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