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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:49:09+00:00 2026-06-09T04:49:09+00:00

I have the following code to send users a verification email, which contains some

  • 0

I have the following code to send users a verification email, which contains some variables such as username and token for verification purpose. The variable obviously changes on an individual basis. However, I would like to store this message separately in the PHP include_path so that I can re-use it somewhere else if need be. I don’t want to hardcode it like it is now:

$to = $username;
$subject = 'Account Verification';
$now = date('Y-m-d H:i:s',time());
$message = "
Date sent:$now

Thanks for signing up! 

Your account has been created, however we need to verify that this is your email address. Here is your verification token which you should copy and paste on the verification page:

<strong>$token</strong>

Alternatively, click the below link to activate your account:

http://localhost/login/verification.php?username=$username&token=$token 

If you did not register with us. You <a href='http://localhost/login/'>can click</a> here to report this to us, or ignore this email.

Thanks,

The LocalHost Team
";
mail($to, $subject, $message);

So three questions:

  1. How do I store this message to be like a template in such a way the variables are still accessible?
  2. How do I turn this message into a nicely HTML formatted message with html markups?
  3. Can I do this:

    $to = $username;
    $subject = ‘Account Verification’;
    $now = date(‘Y-m-d H:i:s’,time());
    $message = include “verification_template.php”;
    mail($to, $subject, $message);

  • 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-09T04:49:10+00:00Added an answer on June 9, 2026 at 4:49 am

    I solve the inclusion like this:

    ob_start();
    include $filename;
    $message = ob_get_clean(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code to send an email to the users. $mes_body.=Click to
I have created one windows service which send an email notifications to users (list
I have to written the following code to send a mail using PHP in
I have the following code that works on PHP5 to send a HTTP POST
I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using
Hai guys, I had the following code to send different mails to differnt users
I have the following code, which is supposed to create a form on the
The following is the program, which I am trying to send e-mail. The code
I have the following code which is executed from the command line: import cgi,time,os,json,sys,zipfile,urllib2
I have the following code: <?php if (!$user) { ?> <div class=fb-login-button data-perms=email,user_birthday,publish_stream>Login with

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.