Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7409779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:08:04+00:00 2026-05-29T06:08:04+00:00

I am using spring mail to send an email via google’s smptp server. I

  • 0

I am using spring mail to send an email via google’s smptp server. I am setting my email templates “From” header but for some reason when I do receive the mail as a sender I get the owner of the smtp account. (which happens to be me again).

MimeMessage message = mailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message);
helper.setText(forgottenPassowrdMailTemplate.getText()
                   .replace("%firstName%", token.getUser().getFirstName())
                   .replace("%lastName%", token.getUser().getLastName())
                   .replace("%link%", url + token.getToken()), true);
        helper.setTo(token.getUser().getEmail());
        helper.setFrom(forgottenPassowrdMailTemplate.getFrom());
        helper.setSubject(forgottenPassowrdMailTemplate.getSubject());

am I forgetting something ? I a am explicitly setting the “From” header

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:08:04+00:00Added an answer on May 29, 2026 at 6:08 am

    You are setting a from address that is different from the account’s address. There are security measures by Google to avoid abuse, which could be fatal if you could just send with any arbitrary from address via Google’s SMTP server. You need to link and verify your other account with the account you want to send the mail with. See here. Your original email address will still be available in the headers and visible to the receipient.

    But why don’t you just use the other accounts credentials (and mail server, if it is not a Google account)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send an email (using Outlook mail) from a jsp page.
I am trying to send an email via GMail from ASP.Net using the code
How to set from when sendin email via smtp server with using microsoft c#
Hi guys for some weird reason I'm unable to send email using zend mail
I'd like to send a text outline via email using MFMailComposeViewController. I'm currently doing
I need to send mail using Gmail SMTP, but it's showing Failure sending mail.
I am using this code to send an SMTP email via the yahoo SMTP
I'm using tomcat 7 and Spring 3.0.5 and I'm trying to send email using
I am trying to use the below code to send email from asp.net(C#). using
I'm currently using JavaMail and Spring to send email in HTML. As it happens,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.