If your JSP application can load pages but email-related features are failing, the problem is usually not the JSP code itself. In most hosting setups, outbound and inbound email depend on separate services such as DNS, SMTP authentication, SPF, DKIM, reverse DNS, port access, and the mail configuration in your application server. On a UK hosting account using Plesk and My App Server, these components must work together for Java mail features to behave correctly.
This article explains the most common reasons why email features stop working in a JSP web app, how to identify whether the issue is in your application, your mail service, or your domain configuration, and what you can do in Plesk to fix it. It is especially useful for JSP hosting, Tomcat hosting, servlet hosting, and private JVM hosting on shared hosting accounts.
Why JSP email features fail even when the site itself works
A JSP application can render HTML pages successfully while email functions still fail because mail is a separate dependency. A page request uses HTTP and the application server; email sending often uses SMTP, and receiving may depend on MX records, mailbox setup, or mailbox routing. If any of these parts are misconfigured, the website may appear healthy while the email feature breaks.
Typical examples include:
- Contact forms that submit successfully but no email is received.
- Account activation or password reset emails not being sent.
- JavaMail exceptions such as authentication errors, connection timeouts, or TLS handshake failures.
- Emails going to spam or being rejected by the remote mail server.
- Inbound mail not reaching the mailbox because DNS records are incorrect.
In a managed hosting environment, the most common causes are DNS misconfiguration, wrong SMTP settings in the app, blocked outbound ports, missing SPF/DKIM alignment, or a mismatch between the domain used by the application and the domain configured in the mail service.
Check whether the problem is outbound mail or inbound mail
Before changing settings, identify the direction of the failure. This helps narrow down the cause quickly.
Outbound mail problems
Outbound mail is when your JSP app sends messages, such as notifications, registrations, or form submissions. If outbound mail is broken, check:
- SMTP host, port, username, and password
- TLS or SSL settings in JavaMail
- Whether the application server can reach the mail server
- Spam filtering and sender reputation
- SPF, DKIM, and DMARC records for the sending domain
Inbound mail problems
Inbound mail is when messages are received by a mailbox on your domain. If inbound mail is not working, check:
- MX records in DNS
- Mailbox existence and quota
- Whether mail is routed to the correct service
- Domain verification and DNS propagation
Many JSP applications only send email, so in practice the issue is usually outbound SMTP delivery rather than receiving mail directly inside the app.
Most common causes in JSP hosting and Plesk
Incorrect SMTP configuration in the Java application
Java applications usually send email through JavaMail or a similar library. If the SMTP settings are wrong, the mail will fail even though the app runs normally.
Check the following:
- SMTP host name is correct
- SMTP port matches the service you are using
- Authentication is enabled when required
- The username is the full mailbox address if needed
- The password is current and not expired
- TLS or SSL is configured according to the server requirements
For example, if your host requires authenticated SMTP on a secure port, using a plain unauthenticated connection will usually fail. Likewise, some servers reject legacy SSL settings while accepting STARTTLS on a modern port.
Wrong DNS records for the domain
Email delivery depends heavily on DNS. If MX, SPF, DKIM, or DMARC are missing or incorrect, messages may be rejected, delayed, or filtered as spam.
Common DNS issues include:
- The MX record points to the wrong mail server
- The SPF record does not include the sending service
- DKIM is not enabled or the key has not been published
- DMARC policy is too strict for the current setup
- The domain uses outdated or conflicting mail records
In Plesk, domain-level DNS settings should be reviewed carefully if your Java app sends mail using the same domain as the website.
Missing or invalid sender authentication
Modern mailbox providers check whether the sender is allowed to send mail from that domain. If your application sends from no-reply@yourdomain but the domain has no SPF or DKIM alignment, the message may be blocked or marked as suspicious.
This is especially important when the application sends high-volume transactional email such as password resets, ticket confirmations, or order notifications.
Outbound port restrictions
On some hosting environments, direct mail delivery over certain ports may be restricted for security reasons. If your JSP app tries to connect to SMTP on a blocked port, it may time out or fail to connect.
Typical symptoms include:
- Connection timed out
- Connection refused
- Unable to negotiate TLS
- Mail works in local testing but not on the hosting account
If the platform expects you to use authenticated SMTP through the mail service provided with the hosting account, make sure your application is not attempting to deliver mail directly to recipient servers unless that is explicitly supported.
Wrong Java version or library compatibility issue
In My App Server, you can choose a Java version and run your own Tomcat or JVM instance within the hosting account. Email libraries can behave differently across Java versions, especially when older code depends on deprecated TLS settings or older mail APIs.
If email stopped working after a Java or Tomcat change, review:
- Java version selected in My App Server
- JavaMail or Jakarta Mail dependency version
- Compatibility of your app with the selected JVM
- Any custom certificates imported into the JVM trust store
Certificate trust and TLS handshake errors
Secure SMTP connections require the JVM to trust the mail server certificate chain. If the certificate is missing, expired, or signed by an authority not trusted by the JVM, the connection can fail during the TLS handshake.
Symptoms often include SSL exceptions, handshake failures, or authentication succeeding but sending still failing. This can happen when:
- The mail server certificate changed
- The JVM trust store is outdated
- The app uses strict certificate validation
- The SMTP host name does not match the certificate
Mailbox quota or service-side limits
If you are sending from a mailbox hosted on the same account, mail delivery may fail if the mailbox is full or if service limits are being exceeded. A form can submit successfully, but the outgoing mail queue may not process the message.
Check for:
- Mailbox storage quota reached
- Daily sending limit exceeded
- Temporary suspension due to abuse protection
- Message size too large, including attachments
How to troubleshoot email features in a JSP app
1. Confirm the app can reach the SMTP server
First, make sure the JSP app can connect to the SMTP service from the hosting environment. If possible, use a simple test script or a small Java class to attempt a basic authenticated send. This isolates the mail layer from the rest of the application.
What to verify:
- SMTP hostname resolves correctly
- Connection opens on the expected port
- Authentication works with current credentials
- TLS or SSL is accepted by the server
If the test fails, the issue is usually infrastructure or configuration, not your JSP pages.
2. Review the JavaMail settings in your application
Check your mail configuration properties carefully. A single wrong value can break the entire flow.
Common settings to inspect include:
mail.smtp.hostmail.smtp.portmail.smtp.authmail.smtp.starttls.enablemail.smtp.ssl.enablemail.smtp.from- Timeout values for connection and socket operations
Also confirm that your code is not swallowing exceptions. A common problem in JSP applications is that the mail call fails, but the exception is caught and never logged clearly enough to diagnose the real issue.
3. Verify DNS records for the domain
In Plesk, review the domain’s DNS zone and make sure email-related records match the way the app sends mail. For a domain used in the sender address, the following are particularly important:
- MX record for mailbox delivery
- SPF record authorising the sending server or service
- DKIM signing enabled if available
- DMARC policy aligned with your mail strategy
If you changed nameservers recently, remember that DNS propagation can take time. During that period, some recipients may see failures while others receive messages normally.
4. Check the sender address used by the application
The From address should match a domain that is configured to send mail. Avoid using arbitrary addresses or domains that are not under your control. Many providers reject messages if the envelope sender and visible sender are inconsistent or if the domain has no valid authentication.
Good practice is to send from a mailbox or address such as:
- noreply@yourdomain
- support@yourdomain
- notifications@yourdomain
If you use a third-party SMTP relay, make sure the SPF record includes that provider and that the From address is permitted by their service.
5. Inspect the application server and mail logs
With My App Server and Tomcat-based hosting, logs are one of the fastest ways to find the real cause. Review the application logs, Tomcat logs, and any mail-related error messages. Look for:
- Authentication failure
- SMTP 4xx or 5xx responses
- Connection timeouts
- Certificate errors
- Invalid address format
- Message rejected by policy
If logs are sparse, temporarily increase logging for the mail component while testing. This is often the quickest way to identify whether the failure is happening before connection, during authentication, or after the message is handed off.
6. Test with a simple message first
Before debugging a full contact form or registration workflow, test a minimal email message with plain text and a single recipient. Remove attachments, HTML formatting, and advanced headers while troubleshooting. Once basic delivery works, reintroduce the more complex parts.
This approach helps isolate whether the issue is:
- SMTP connectivity
- Message formatting
- Template rendering
- Attachment handling
- Recipient validation
My App Server and Tomcat-specific points to check
On a hosting platform that provides My App Server, you control your own Java/Tomcat environment from Plesk. That is helpful for JSP applications, but it also means the mail stack used by the app should be reviewed inside the application context, not only in the control panel.
Selected Java version
Make sure the Java version selected for the app is compatible with your mail library and security settings. Older mail code may fail under stricter TLS defaults, while newer libraries may require a newer runtime.
Private JVM or custom Tomcat settings
If you are using a private JVM or a custom Tomcat setup, confirm that the JVM has access to the correct certificates and that any custom startup parameters do not interfere with TLS verification or networking.
WAR deployment and environment variables
If SMTP credentials are injected through environment variables, check that the values are present after deployment and not overwritten by another configuration layer. A frequent issue is a correct local setup but missing values in the deployed WAR environment.
Resource limits
Shared hosting plans have practical limits on memory, CPU usage, and service usage. While email sending itself is not usually heavy, a poorly configured application can become unstable under load. If the JVM is close to its memory limit, background email tasks may fail intermittently or time out.
Fix checklist for JSP email issues
Use this checklist when a JSP app in a UK hosting environment cannot send or receive email properly:
- Confirm whether the issue is outbound sending or inbound receiving.
- Test SMTP connectivity from the application environment.
- Verify SMTP host, port, username, password, and TLS settings.
- Check that the From address belongs to a verified domain.
- Review SPF, DKIM, DMARC, and MX records in DNS.
- Look for blocked ports or connection timeouts.
- Inspect application, Tomcat, and mail logs for exact error messages.
- Confirm mailbox quota and sending limits are not exceeded.
- Check Java version compatibility with the mail library.
- Test with a simple plain-text email before using templates or attachments.
Examples of common error messages and what they usually mean
Authentication failed
This usually means the SMTP username or password is wrong, the account is locked, or the server requires a different authentication method.
Connection timed out
This often indicates a network problem, blocked port, incorrect hostname, or a service that is not reachable from the hosting account.
SSL handshake failure
This usually points to a certificate trust issue, wrong TLS version, or a mismatch between the SMTP host name and the certificate.
554 message rejected
This often means the receiving server rejected the message due to SPF, DKIM, reputation, policy, or sender alignment issues.
Mailbox unavailable
This can indicate a wrong recipient address, a missing mailbox, or an MX configuration problem.
When to contact hosting support
If you have already checked the application settings, DNS records, and SMTP credentials, and email still does not work, contact support with the exact error details. Include the following information:
- Domain name and affected application path
- Whether the issue is sending or receiving
- Exact error message from the logs
- SMTP host and port in use
- Whether the app runs on My App Server, custom Tomcat, or another Java setup
- Recent changes to DNS, certificates, Java version, or mail settings
This makes it easier to determine whether the issue is inside the JSP app, in Plesk configuration, or in the surrounding mail service.
FAQ
Why does my JSP app work but contact form emails do not send?
Because the web application and the mail service are separate systems. The page can load correctly while SMTP authentication, DNS, or TLS settings still fail.
Do I need SPF and DKIM for a JSP application?
Yes, if your app sends email from your domain. SPF and DKIM improve deliverability and help prevent rejection or spam filtering.
Can I send mail directly from Tomcat without SMTP authentication?
Only if your hosting environment explicitly allows it and the destination server accepts it. In most cases, authenticated SMTP is the safer and more reliable option.
Why do emails go to spam even though they are sent successfully?
Successful sending does not guarantee inbox placement. Missing SPF, DKIM, weak sender reputation, or inconsistent From addresses can cause filtering.
What should I check first in Plesk?
Start with the domain’s DNS zone, mailbox setup, and any mail-related settings that match the sender address used by the application. Then verify the Java mail configuration in the app itself.
Could the Java version cause email problems?
Yes. Some mail libraries and TLS settings behave differently across Java versions. If email stopped working after a runtime change, check compatibility first.
Conclusion
When email features do not work in a JSP web app, the root cause is usually not the JSP page itself but the surrounding mail stack: SMTP settings, DNS records, TLS certificates, sender authentication, or hosting limits. In a My App Server setup, it is important to check both the Java application and the hosting control panel side by side.
Start with the SMTP connection, then review DNS, sender identity, and logs. If the app runs on Tomcat or a private JVM, confirm Java compatibility and certificate trust as well. With a structured check, most email issues can be traced quickly and fixed without changing the whole application.