Hey everyone,
I’m working on a Go project that sends emails through the MailGun API. Everything’s set up correctly, but I’m facing an annoying issue. The ‘From’ address in the email headers shows up with an ‘on behalf of’ tag. It looks like this:
[email protected] on behalf of Sender Name <[email protected]>
What I want is for it to appear clean and simple:
Sender Name <[email protected]>
I’ve already set up SPF and DKIM as MailGun suggested, and they’re both passing checks. I’m also using SetDKIM(true) in my code. Am I missing something? Maybe there’s a hidden setting or extra step I need to take?
Any help would be awesome. Thanks!
hey jack, had this prob too. check ur mailgun settings, make sure ur using the right domain for sending. also, try adding ‘o:tag’ with ‘origin=sender’ in ur API call. that fixed it for me. if not, hit up mailgun support, theyre pretty helpful with this stuff. good luck!
I’ve encountered this issue as well. One crucial aspect often overlooked is the alignment between your MailGun domain and the ‘From’ address. Ensure they match exactly. Also, verify that your DNS settings are properly configured for both SPF and DKIM.
Another approach worth trying is to use MailGun’s ‘o:tag’ parameter in your API call. Set it to ‘origin=sender’ when sending your email. This can sometimes override the ‘on behalf of’ behavior.
If these steps don’t resolve the issue, consider reaching out to MailGun support directly. They might have specific insights based on your account configuration that could solve this persistent problem.
Remember, email delivery intricacies can vary based on recipient email servers, so testing with multiple providers is advisable.
I’ve dealt with this exact issue before, and it can be frustrating. The ‘on behalf of’ tag is often a result of mismatched sender domains. Here’s what worked for me:
- Make sure your sending domain in MailGun matches the ‘From’ address domain exactly.
- Double-check your SPF record includes MailGun’s servers.
- Ensure your DKIM is set up correctly for the sending domain.
- In your Go code, try setting the ‘From’ address to match the MailGun sending domain.
If all else fails, consider using MailGun’s Sender Identity feature. It allows you to authenticate additional sending domains, which might solve your problem.
Remember, it can take up to 48 hours for DNS changes to propagate fully. If you’ve made recent changes, give it some time before panicking.
Hope this helps! Let me know if you need more details on any of these steps.