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 6643915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:06:22+00:00 2026-05-26T00:06:22+00:00

I am very new to email servers and sending email with PHP… Is it

  • 0

I am very new to email servers and sending email with PHP…

Is it possible to have email sent from a PHP script on my server encrypted using SSL or TLS before it is sent to the recipient’s mail server?

I need to ensure only the intended recipient can read the email, in case the transmission is intercepted on its journey to their mail server.

I am not sure if this is possible, as the recipient’s mail server would not know the public key right? So how could it decrypt the email?

As background, I am not actually hosting email accounts for anyone – so it is not a case of the users authenticating with my server and downloading emails for them hosted there. I just have a script triggering an alert email to be sent from “notifications@danbaylis.com” (which is not a real email address on the server so you can’t reply to it) to the user’s real email address (which my application knows). I need a way to make sure this email is securely sent from PHP on my server, to the recipients mail server.

I have looked at the mail() function in PHP, as well as the PHPMailer class – but I am not sure how I would configure either of these methods to securely send the email.

All my research just shows how to install SSL in on my server so users can securely download email stored on my server – which is not what I am trying to do here.

I am running Centos5.7 which I believe has a mail server installed, though I am not sure if PHP actually uses that by default..

Thanks for any help!

  • 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-26T00:06:22+00:00Added an answer on May 26, 2026 at 12:06 am

    The type of encryption you are looking for is not SSL/TSL, which is used to encrypt transmission between the client (PHP) and the SMTP server which will send it on. SSL/TLS makes no guarantee that the data will be encrypted all the way to its endpoint. In fact, it almost certainly won’t be as the data is relayed between SMTP servers and switches along the way.

    Instead you are looking for PGP encryption, which can be implemented in PHP using the GnuPG functions. You must encrypt the message using your recipient’s public key. It can then only be decrypted and read with the recipient’s private key, held by the recipient alone.

    To implement this in mail(), you would first encrypt the message body, then pass the encrypted, ascii armored block to mail() as its third parameter. Message headers will not be encrypted, only the body.

    Addendum

    The way secure message transmission is handled by most banks and medical services (in the US, anyway) is not to send email at all. Instead, messages which must be kept secure are stored in a user’s “inbox” with the website. The user must login (over SSL) to the website to read messages in the secure inbox. Email is only sent to notify the user that new messages are waiting.

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

Sidebar

Related Questions

I am very new to PHP; ADD.PHP - I have a form that collects
I am very new to PHP, trying to write a script which connects to
Very new to using Raphael.js I'm looking at the tutorials and I am able
I very new to Python, and fairly new to regex. (I have no Perl
Im very new to all coding including jquery. I though this would have been
I am very new to jQuery and javascript. I have an autocomplete box setup
I am trying to send an email using the following very standard code. However,
I have a very strange problems in a PHP Soap implementation. 1) I have
I want to validate email address in html form. I have very little knowledge
I want to make a simple HTTPRequest to a php script and I have

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.