?
Solved

setting up phpmailer on vista

Posted on 2009-12-31
4
Medium Priority
?
404 Views
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.

Thanks
OldHatt45
0
Comment
Question by:OldHatt45
  • 3
4 Comments
 
LVL 29

Expert Comment

by:chilternPC
ID: 26157707
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
0
 

Author Comment

by:OldHatt45
ID: 26158392
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?

Thanks
OldHatt45
<?php 
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 = "me@mail.net"; // this is the From adress (the adress the email came from) 
$mail->FromName = "J Q Public"; 
  
$mail->AddAddress("jqp@mail.net"); // 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; 
} 
else 
{ 
   echo 'Message has been sent.'; 
} 
?>

Open in new window

0
 

Author Comment

by:OldHatt45
ID: 26158403
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.

Thanks
OldHatt45
0
 

Accepted Solution

by:
OldHatt45 earned 0 total points
ID: 26174242
I figured out what I needed to do.  So I am cancelingthis question.
Thanks
OldHatt45
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

830 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