You are here: Re: phpmailer error « All PHP « IT news, forums, messages
Re: phpmailer error

Posted by Mike on 09/01/06 15:17

Dennis de Wit wrote:
> Mike wrote:
> > Mike wrote:
> >> Dennis de Wit wrote:
> >>> Mike wrote:
> >>>> Thanks Dennis,
> >>>>
> >>>> Basically the incoming and outgoing servers are called the same -
> >>>> mail.mysite.co.uk.
> >>>>
> >>>> I already asked support and there response was...
> >>>>
> >>>> I've checked with our engineers, and I'm afraid that the server is
> >>>> doing exactly what it's meant to be doing, and there isn't a way round
> >>>> it. This is configured this way for security purposes to make it easy
> >>>> to track down compromised scripts. Please be aware that the "On Behalf
> >>>> Of" message will only show on some mail clients.
> >>>>
> >>>> Major pain!!
> >>>>
> >>>> Mike
> >>>>
> >>> I'd look for a different host; or accept the "on behalf of" message.
> >>>
> >>> Take a glass bottle, fill it with petrol, stick in an old newspaper, go
> >>> to your webh...
> >>>
> >>> ... oh wait; you did not get that info from me.
> >>>
> >>> Dennis
> >> Yes, I think your right, except I just paid £100 for it and to see "On
> >> Behalf Of" looks un-professional!
> >>
> >> Thanks
> >>
> >> Mike
> >
> > Its fixed!!!
> >
> > The only code I need is as follows...
> >
> > <?php
> > require("class.phpmailer.php");
> > $mail = new PHPMailer();
> > $mail->IsSMTP(); // send via SMTP
> > $mail->From = "info@mysite.co.uk";
> > $mail->FromName = "Info";
> > $mail->AddAddress("mike@anothersite.co.uk","Mike");
> > $mail->AddReplyTo("info@mysite.co.uk","Info");
> > $mail->WordWrap = 50; // set word wrap
> > $mail->IsHTML(true); // send as HTML
> > $mail->Subject = "Here is the subject again";
> > $mail->Body = "This is the <b>HTML body. Isn't it cool</b>";
> > $mail->AltBody = "This is the text-only body. Istn't it cool";
> > if(!$mail->Send())
> > {
> > echo "Message was not sent <p>";
> > echo "Mailer Error: " . $mail->ErrorInfo;
> > exit;
> > }
> > echo "Message has been sent";
> > ?>
> >
> > If I take out $mail->IsSMTP(); it puts the "On Behalf Of" in the from
> > address, if I leave it in it takes it out. I don't even need to
> > specify a SMTP server, username or password.
> >
> > Thanks for all your help.
> >
> > Mike
> >
>
> I think that's because it uses the mail function if you don't add that
> line. Now it uses your smtp server.
>
> what did you change?
>
> Dennis

I just removed all the SMTP server info (username, password etc) as the
default host is "localhost". For some reason it doesn't require the
passwords etc.

Oh Well, At least its working now!

Mike

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация