Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call to a member function IsSMTP() on a non-object

Status
Not open for further replies.

usit

Technical User
May 2, 2011
8
US
I striped the mail section of the registration page of my crashed web site into smaller sections and got the smallest working. On the way back to reassembling the original mail code this error was thrown: Call to a member function IsSMTP() on a non-object
with a line number pointing to this statement:
Code:
$mail->IsSMTP();
Another statement prints on the screen in the working part of the output: Fatal error: Call to undefined method stdClass::IsSMTP()
I cannot find the latter -- stdClass::IsSMTP() -- in my code. I have no idea what stdClass is. The double :: demarks a static method, but I haven't found it. The statement $mail->IsSMTP(); has not thrown this error in the smaller snippets.

By the way, the original registration program was written in PHP4 and is now being run in PHP5. I've tried to identify/correct necessary adjustments on this cause.
Any suggestions?
USIT
PS. I discovered a 'gotch-ya!' that cost me too many hours to find. It may help someone else. I had narrowed an error down to one line of code; a require_once statement. I could not find anything wrong with it. Fortunately, I had a working version. I copied and pasted the same line over the failing one and it worked!! I suspected an non-visible character. Unfortunately, the bad line was lost and I couldn't verify this suspicion.
 
stdClass is the standard class. an anonymous object.

isSMTP is a method of phpmailer. you need to make sure that the phpmailer class is included/required before and you have set $mail = new phpmailer

 
You again? Great!
You found it. I'd overlooked new phpmailer(). That fixed it.
Thanks for your quick eye, quick response, and informative answer.

all the best
usit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top