Hi!
I’ve installed PHP mailer, and im having a bit of a problem. Ive placed all the necessery files that i need into a directory, along w/ my php file with the following code:
**Btw,**im aware that the email addys arent the correct ones…
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.central.cox.net"; // SMTP server
$mail->From = "MYEMAIL@gmail.com";
$mail->AddAddress("MYEMAIL@yahoo.com");
$mail->Subject = "First PHPMailer Message";
$mail->Body = "Hi!
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.';
}
?>
Error messege:
Message was not sent.Mailer error: Language string failed to load: connect_host
The PHP Lanugage english file, says that “connect_host” means that “SMTP Error: Could not connect to SMTP host.’;”, BUT, I JUST set up my outlook express using the same smtp server, and it works perfectly.
Any suggestions/links/help?:crying:
I appreciate it, thanks.
don’t use the smtp declaration
[QUOTE=ahmednuaman;2340678]Why not?[/QUOTE]
if he’s having issues w/ it then the quickest and easiest way to “solve” it would be to not use it. there was no other reason than that, don’t look to much into it.
ahmednuaman, those SMTP settings are from my ISP. Im using this free server space to test the pages out, and I’m not sure how to check for their SMTP.
simplistik, the only reason why I used it is b/c the PHP Mailer site instructed me to…I’m pretty much a PHP noob…
Well if I remove SMTP from the code, how will it send the e-mail messege? I know that Ive used a form code b/4 without a SMTP address, but I’m not sure why they had this if it wasnt needed.
What should i do? :crying:
ahmednuaman: I see, thanks for that explanation!
For some reason now that I removed the SMTP stuff from the code, it sends, which makes me wonder why it was needed in the first place??
At least I got it to work.
I see, I guess that explains it all.
I might use my gmail to do that, to learn a little bit more.
Thanks again.
[QUOTE=monkeyface;2340688]simplistik, the only reason why I used it is b/c the PHP Mailer site instructed me to…I’m pretty much a PHP noob…
Well if I remove SMTP from the code, how will it send the e-mail messege? I know that Ive used a form code b/4 without a SMTP address, but I’m not sure why they had this if it wasnt needed.[/QUOTE]
I use phpmailer too and the smtp and pop options are optional. but like ahmednuaman says you do have greater control over what your headers are sending from. but also, if you’re not spamming people or don’t use keywords in your headers and body in the first place your mail will most likely not be caught by a spam blocker. so about 99% of the time there’s really no need to use it for the sake of spam protection. the biggest advantage of it would be emailing from your site, and it looking like it legitimately came from say your gmail account, instead of a private server.
^That makes perfect sense…
Thanks a lot again for all your explanations!!