How to install from a mail address other than smtp authentication mail in java mail

I am specifying the FROM method FROM usinf setFrom (), but I am still receiving emails with the address "FROM" of the SMTP authentication mail identifier. and want to set the dynamic address "FROM" . which keeps changing. What is the RFC282 standard to achieve this.

+7
source share
4 answers

Google solution is

Gmail allows you to send messages with a different email address as the sender, rather than with a Gmail address. This feature allows you to manage multiple accounts from the Gmail interface; it only works if you already have an email account associated with an alternate address

  • Go to the Accounts and Import tab (or the Accounts tab if you're using Google Apps). In the "Send mail as" section, click "Add another email address." In the Email Address field, enter your name and an alternate email address. Choose one of two options: Use Gmail servers to send mail (it’s easier to configure) Use other SMTP servers of the email provider (we recommend this option for professional mail accounts or domains). Note for Google Apps users: Depending on your type of domain2, this feature may be disabled by default. If you have any questions, contact your administrator. If you decide to use Gmail servers:

  • Click "Next" β†’ and click "Send confirmation." Gmail will send a confirmation message to your other email address to confirm that you own it.

  • Open another account and either click on the link in the Gmail message or enter the verification code in the Accounts section of your Gmail settings.

For more information, follow the link below.

https://support.google.com/mail/bin/answer.py?hl=en&answer=22370 .

The overhead is due to the fact that any new address needs an alias that will be set in the Gamil authentication account. This is not suitable for a corporate product application.

Another solution. You can install the mail server (hmailServer). This server allows you to set a custom address from

If any authority knows other solutions, please suggest me.

+5
source

This is up to your mail server. Often, mail servers will prevent you from using any From address except your actual login. This helps prevent spam. Depending on your mail server, there may be ways to convince it that you are allowed to use other From addresses.

+4
source

These are two different things that you are talking about:

The identifier you mention is part of the handshaking smtp protocol, which is usually displayed in the "Return-path" field in the mime header.

While the identifier included in the "FROM" field, which actually appears on the mailing list, is added by the mail server when composing mail.

So, if you can change the mime header, make sure that the β€œFROM:” field contains the identifier that you want to set not for the smtp authentication identifier.

btw his rfc822

We worked on the rediffmail technical team to develop and improve the smtp, pop, and imap protocols.

+2
source

Depending on your mail server and configuration settings

+2
source

All Articles