setting up phpmailer on vista

Posted on 2009-12-31
Last Modified: 2013-12-13
I'm trying to set up phpmailer on my vista (home premium) pc.  I am also running IIS6, php 5 and mysql.  

I've read all the tutorials (at least 6 or 7 of them) and can't quite figure out a few things.

The SMTP thing.  I've got the class.smtp.php file in the right spot (same dir with the class.phpmailer.php file).  
I tried putting in my remote mail host but that doesn't seem to work.
I have tried using both a config file and just a plain php script that calls phpmailer.
Neither way works.  I can provide answers to any questions you have about what I've done/tried.  Just ask, cause I'm not sure what will help to figure this out.

Could someone please explain what i need to set so I can send email.

Question by:OldHatt45
    LVL 28

    Expert Comment

    can you show us your code?   I would put debug statements i the code to check error returns and print out values.
    I believe the mailer parameters changed from php5

    Author Comment

    It's a very simple script:
    Right out of one of the tutorials.
    I think it's as basic as it could possibly be.

    Anyhow, here it is..

    What I'm looking for is, some explanation of the setup.  Do I need the class.smtp.php?  Does this perform the function of an "smtp server"?  Will it send to a remote mail server?

    require("./phpmailer/class.phpmailer.php"); // First we require the PHPMailer libary in our script  
    $mail = new PHPMailer(); // Next we create a new object of the PHPMailer called $mail 
    $mail->IsSMTP();  //Use direct SMTP and skip the mail server mail system.  
    $mail->From = ""; // this is the From adress (the adress the email came from) 
    $mail->FromName = "J Q Public"; 
    $mail->AddAddress(""); // This is the adress to witch the email has to be send. 
    $mail->Subject = "First PHP Email message"; // This is the subject  of the email message. 
    $mail->Body = "Hi! \n\n This is my first e-mail sent through PHP."; // This is the actual email message 
    if(!$mail->Send()) // Now we send the email and check if it was send or not. 
       echo 'Message was not sent.'; 
       echo 'Mailer error: ' . $mail->ErrorInfo; 
       echo 'Message has been sent.'; 

    Open in new window


    Author Comment

    Oh, when I use "real" email addresses, I get this error message:
    SMTP -> ERROR: Failed to connect to server: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)
    SMTP Error: Could not connect to SMTP host. Message was not sent.Mailer error: SMTP Error: Could not connect to SMTP host.


    Accepted Solution

    I figured out what I needed to do.  So I am cancelingthis question.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    731 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

    18 Experts available now in Live!

    Get 1:1 Help Now