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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:14:51+00:00 2026-05-24T17:14:51+00:00

I am designing a PHP page to send an email. An error is occurring.

  • 0

I am designing a PHP page to send an email. An error is occurring. Please check my code carefully and let me know the error in my code.

This is the output which is generated when i run my program:

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

so pls help me to set smtp configuration.

  • 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-24T17:14:51+00:00Added an answer on May 24, 2026 at 5:14 pm

    change $header to $headers, you’ve got $headers = "From: $from\r\n"; and using $header

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

    so whole code would look like

    <?php 
        //change this to your email. 
        $to = "kuntal.pushpendra@gmail.com"; 
        $from = "puskun.pericent@gmail.com"; 
        $subject = "Hello! This is HTML email"; 
        $message = "hello";
        $headers  = "From: $from\r\n"; 
        $headers .= "Content-type: text/html\r\n"; 
        mail($to, $subject, $message,$headers); 
    
        echo "Message has been sent....!"; 
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Designing forms has always been fun, but getting them to send email on the
I am working on a PHP framework and am currently designing error handling. Based
I am using php with code igniter. I am designing a website with php.
I am designing a wordpress page and wish to add a html/php widget to
When designing a lookup table (enum) in SqlServer 2005, if you know the number
I am designing a small website using HTML + JSP. This is my first
I have a page here: http://animactions.ca/Animactions/accueil.php and it has a right column. When the
I usually like defining my pages to know exactly what page does what. However,
When we enter a word in Google image search, a page is returned. This
Let me begin this topic by explaining my background experience with web design. 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.