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

  • SEARCH
  • Home
  • 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 7846339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:33:09+00:00 2026-06-02T17:33:09+00:00

The e-mail is being sent using Spring and java mail sender. Is their anyway

  • 0

The e-mail is being sent using Spring and java mail sender.

Is their anyway I can use a normal jsp view and jstl tags – I don’t want to learn another bunch of tags/syntax ?

Currently my code looks like this :

StringBuffer content = new StringBuffer();
Configuration configuration = freeMarkerConfigurer.getConfiguration();
String templateName = "vslEmail.ftl";
Map<String, String> templateVars = new HashMap<String, String>();
templateVars.put("firstName", "john");
templateVars.put("surname", "doe");
try {
  content.append(FreeMarkerTemplateUtils.processTemplateIntoString(configuration.getTemplate(ftlName), tempalteVars));
}
catch (Exception e) {
  // handle
}
// content.append("<br>Test data");
sendMime(defaultEmailAddress, subject, content.toString());

I would just prefer to reference a jsp instead of the ftl ?

  • 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-06-02T17:33:11+00:00Added an answer on June 2, 2026 at 5:33 pm

    You can explicite render a jsp, but you need a Request Object!

    request.getRequestDispatcher("/WEB-INF/mai/myMail.jsp").include(request, response);
    

    See also this StackOverflow Answer (and the other answers to that question). It shows an example to create a (fake) response object, that allows you to process the created html.

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

Sidebar

Related Questions

I'm using System.Net.Mail to send out a few emails. The emails are being sent
How can I check a problem with mail being sent on my server? I
The following $header is being sent via PHP's mail($to,$subject,$content,$header) command. The mail arrives and
I am using Java Mail api to access a gmail account (not fixed). I
I am using the following program for sending email through Java. When I use
I'm trying to attach a PDF attachment to an email being sent with System.Net.Mail.
I am trying to use PEAR Mail to send using an external smtp server.
If I send e-mails using an Outlook Form the form is being sent with
sending mail along with embedded image using asp.net I have already used following but
I am using PEAR mail system to send authenticated mails.I need to send HTML

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.