PHP Classes

Why does this "class" use Globals instead of class-attributes...

Recommend this page to a friend!

      Send mail from any SMTP server  >  All threads  >  Why does this "class" use Globals...  >  (Un) Subscribe thread alerts  
Subject:Why does this "class" use Globals...
Summary:Package rating comment
Author:Christopher Kramer
Date:2009-09-12 09:32:35
Update:2009-09-12 11:05:56


Christopher Kramer rated this package as follows:

Utility: Sufficient
Consistency: Insufficient
Examples: Sufficient

  1. Why does this "class" use Globals...   Reply   Report abuse  
Picture of Christopher Kramer Christopher Kramer - 2009-09-12 09:32:36
Why does this "class" use Globals instead of class-attributes to set mail-details?
The "helper classes" which are made use of look quite good, but the wrapper around seems quite useless to me.
Putting SMTP Authentification details into an ini-file is also a bad idea I think because of security issues (you'd have to make sure that the file cannot be downloaded with a .htacces-file for example).
But one could use loadsmtp.php as an example of how to use the helper class (phpgmailer - which makes use of the SMTP helper class).

  2. Re: Why does this "class" use Globals...   Reply   Report abuse  
Picture of Gourab Singha Gourab Singha - 2009-09-12 11:05:56 - In reply to message 1 from Christopher Kramer
I use globals in my "SENT MAIL FROM ANY SMTP SERVER" class because i make it user friendly. I do not want any developer like me spent lots of his important time to send a mail from any smtp server using existing smtp mail server class.I want to make there work more faster.They just need Recipent address, mail subject , mail content , and smtp server address and uername and password to send a mail.I want to make a mail class which dose not need a documentation just easy as reading like a,b,c so i use globals.If some one do not know what is oop's he will use my code to send there mail from any smtp mil server.

Please leave any comment you have.

Thanks for your comment


Gourab Singha