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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:50:55+00:00 2026-06-11T22:50:55+00:00

I am currently looking for a way to send an email notification with WordPress

  • 0

I am currently looking for a way to send an email notification with WordPress website. So for example, when user visits page A, there’ll be an email notification sent in the background.

I haven’t got much experience with web development in WordPress environment, so can anyone give me a pointer here? Where should I start?

Thanks.

Edit:

I have tried both mail() & wp_mail() functions but none of them seemed to work for me. When I visited that page, no email got sent out. I’ve also checked the template for that page, which is just default template. Perhaps I was editing the wrong file??

Edit2:

I guess mail function probably hasn’t yet been enabled by the hosting provider.

  • 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-11T22:50:56+00:00Added an answer on June 11, 2026 at 10:50 pm

    Here’s a very basic piece of php code that sends an html email.

    <?php
    if(is_page(123))
    {
    
    $fromName = 'Auto email notification system';
    
    $subject = 'Confirmed';
    
    /* Mail Address */
    $toAddr = 'me@domain.com'; 
    $bccAddr = 'bccperson@domain.com'; 
    $fromAddr = 'no-reply@domain.com';
    /* End Mail Address */
    
    
    /* Mail Body */
    $msg = '
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
    </head>
    <body>
    my messages about confirmation...
    </body>
    </html>
    ';
    
    $msg = wordwrap($msg, 70);
    /* End Mail Body */
    
    
    /* Mail Headers Setup */
    $headers = array();
    $headers[] = "MIME-Version: 1.0";
    $headers[] = "Content-type: text/html; charset=utf-8";
    $headers[] = "From: ".$fromName." <".$fromAddr.">";
    $headers[] = "Bcc: <".$bccAddr.">";
    /* End Mail Headers Setup */
    
    
    mail($toAddr, $subject, $msg, implode("\r\n", $headers));
    
    }
    ?>
    

    And I placed above code in header.php file, towards the bottom and it worked for me.

    Thank you guys for all the suggestions and help.

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

Sidebar

Related Questions

I'm currently looking for a way to provide the user with being able to
Is there any way to speed up this Magento code? Currently it is looking
I am currently looking for a way to remove fullstops from a string in
I'm currently looking for a way to launch the default browser application on Android
I'm looking for a way to control which monitors are currently being used via
I am looking into a way to more securely send emails from our application.
I'm looking to use the HTML Bridge to send data currently in an ObservableCollection
I'm looking for a way to invalidate my current activity's option menu with Mono
Currently looking into learn new technology and silverlight is on the potential list. However,
I am currently looking to deploy a web forum on the azure platform. I

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.