PHP Mail from Windows

Posted on 2006-05-01
Last Modified: 2013-12-13
I am new to PHP and I have an Apache server running on a Windows XP box hosting a small group forum with authentication. The website package I am using has the ability to send mail but I am assuming that this was written for a unix box. All this needs to do is send a email that says "Yes you are signed up". All the help i have seen on their site is for SendMail. Which i have come to learn is a Unix thing. I also need to send it through a google account which means i need to designate the port and password and such. I came across mention of using PHPMailer. But despite my best intentions I can't make sense of their install directions. I am used to just unzipping a package and adjusting a config file.. and things work.. what am i missing. Can someone help me with a step by step install instructions? With google would be even more of a bonus!
Question by:datagears
    1 Comment
    LVL 13

    Accepted Solution

    Hi, you just need to put class.phpmailer.php and class.smtp.php in the directory with your mailer script - I'll call this script sendit.php:

    $mail = new PHPMailer();
    $mail->IsSMTP(); // telling the class to use SMTP
    $mail->Host = ""; // your SMTP server (this should be your LOCAL mail server from your ISP - it doesn't have to be [ie.])
    $mail->From = ""; // your address
    $mail->AddAddress(""); // your recipient

    $mail->Subject = "first mailing";
    $mail->Body = "hi ! \n\n this is First mailing I made myself with PHPMailer !";
    $mail->WordWrap = 50;

       echo "Message was not sent";
       echo "Mailer Error: " . $mail->ErrorInfo;
       echo "Message has been sent";
    There is no config file for PHPMailer - you just need to copy the class files to a dir that you can access, then 'require()' those files

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to count occurrences of each item in an array.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now