| | |
send email
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2008
Posts: 39
Reputation:
Solved Threads: 0
hi all;
•
•
•
•
I apreciate all the replies i had been read, but seems i got problem in sending an email,
well this is my problem. I could not display the proper format after i send the email.
•
•
•
•
Im looking into this kind of format after i send the email. this should be the ouput.
PHP Syntax (Toggle Plain Text)
subject : test From : jhon stone [jhone@xxxxxxxxxxx.xxx] to : reciepient message : this is only for testing.
•
•
•
•
here is the whole code that i made
PHP Syntax (Toggle Plain Text)
class request { var $mail_id; var $email; var $name; var $address1; var $guestEmail; var $guestPhone; var $senderName; var $subject; var $message; function createHeader() { $from = "From : $this->senderName <$this->guestEmail>\r\n"; $input->header = $from; return $input->header; } function send_email($input){ $input->createHeader(); if (@mail($input->to, $input->subject, $input->message, $input->header)){ return true; } else { return false; } }
I don't see an instantiation of any object into $input. Even if that is the reference you are sending into send_email(), you aren't going to be able to use that in createHeader() because it is out of scope.
Last edited by R0bb0b; Aug 13th, 2008 at 1:01 am.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
•
•
Join Date: Aug 2008
Posts: 381
Reputation:
Solved Threads: 33
You do realize -- I hope -- that having a publicly accessible script that sends emails is a HUGE security risk on a server unless proper precautions are observed. It is an open doorway for DOS (Denial Of Service) attacks on the server (basically using all of its resources) and also to be used as a SPAM relay by anyone who finds it...
Just thought I'd point that out.
Having said all that, have you looked over the php.net mail() function definition and discussions?
http://us.php.net/manual/en/function.mail.php
Good luck
Just thought I'd point that out.
Having said all that, have you looked over the php.net mail() function definition and discussions?
http://us.php.net/manual/en/function.mail.php
Good luck
Last edited by langsor; Aug 13th, 2008 at 1:42 am.
I don't see any evidence that this is a publicly accessible script. Its just a general mail class not much different than having a phpMailer class in your docroot. Its how you use it that matters. Just verify that a human is using your html form(commonly done with a random number generated within an image), validate all user input on the form handler that this html form submits to, validate all includes if you use a url query string to identify included files(I use a function to pull an array of file names from the subfolder in question and verify that the requested file is in that array), assign a value to all variables right when they are defined and turn off register globals for Christ's sake, you don't need them.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
![]() |
Similar Threads
- can not send email and cannot send file through instant messaging (Windows NT / 2000 / XP)
- Can't send email (Windows NT / 2000 / XP)
- unable to upload files or send email on wireless (Windows NT / 2000 / XP)
- Cannot Upload files or send email on wireless (Web Browsers)
- Using PHP to Send Email to a single DB list member every 24 hrs. (PHP)
- Batch file to send email!! (Windows NT / 2000 / XP)
- Not able to send email by "MAIL" (OS X)
Other Threads in the PHP Forum
Views: 475 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl customizableitems database date directory display download dynamic echo email error file files folder form format forms forum function functions google headmethod href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail malfunctioning menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube





