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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:09:31+00:00 2026-05-23T15:09:31+00:00

Trying to send an activation email for newly registered users, here’s the code so

  • 0

Trying to send an activation email for newly registered users, here’s the code so far:

$to = $email;
$subject = "Activate your account!";
$headers = "From: noreply@test.com";    
$body = "..."

$mail($to, $subject, $body, $headers);

In the tutorial by phpacademy, the instructor used

ini_set("SMTP", $server);

I cannot figure out what to do. I think that my SMTP server should be my Yahoo account. How can I send the emails?

  • 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-23T15:09:31+00:00Added an answer on May 23, 2026 at 3:09 pm

    If you are going to sending email with PHP mail function you have to setup a SMTP server first in your PC. Other way, you can use a class to do this with out setting any thing in your PC. PHP mailer known to do this with few lines:
    here is an example from the site of the project:

    <?php
    
    require("class.phpmailer.php");
    
    $mail = new PHPMailer();
    
    $mail->IsSMTP();  // telling the class to use SMTP
    $mail->Host     = "smtp.example.com"; // SMTP server
    
    $mail->From     = "from@example.com";
    $mail->AddAddress("myfriend@example.net");
    
    $mail->Subject  = "First PHPMailer Message";
    $mail->Body     = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
    $mail->WordWrap = 50;
    
    if(!$mail->Send()) {
      echo 'Message was not sent.';
      echo 'Mailer error: ' . $mail->ErrorInfo;
    } else {
      echo 'Message has been sent.';
    }
    ?> 
    

    Official web site: http://phpmailer.worxware.com

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

Sidebar

Related Questions

I am trying to send the user an email and I used this code:
Rails 2.3.11 I'm trying to send an activation-style email whenever a user registers. The
Im trying to send a HTML email and I have this piece of code:
I'm trying to send an email in Java but when I read the body
I am trying to send an email from a site I am building, but
I'm trying to send email to Active Directory distribution groups. I know you can
I'm trying to send an email to several recipients when a new row is
I am trying to send an email with attachments and found the java mail
I'm trying to send an email using JavaMail API. I have jdk 1.5 installed
I'm trying send flash messages and welcome notices to users if it's their first

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.