send email

Reply

Join Date: Jul 2008
Posts: 39
Reputation: god_1896 is an unknown quantity at this point 
Solved Threads: 0
god_1896 god_1896 is offline Offline
Light Poster

send email

 
0
  #1
Aug 12th, 2008
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.
  1. subject : test
  2. From : jhon stone [jhone@xxxxxxxxxxx.xxx]
  3. to : reciepient
  4.  
  5.  
  6. message : this is only for testing.

here is the whole code that i made
  1. class request {
  2.  
  3. var $mail_id;
  4. var $email;
  5. var $name;
  6. var $address1;
  7. var $guestEmail;
  8. var $guestPhone;
  9. var $senderName;
  10. var $subject;
  11. var $message;
  12.  
  13. function createHeader() {
  14.  
  15. $from = "From : $this->senderName <$this->guestEmail>\r\n";
  16. $input->header = $from;
  17. return $input->header;
  18. }
  19. function send_email($input){
  20.  
  21. $input->createHeader();
  22.  
  23. if (@mail($input->to, $input->subject, $input->message, $input->header)){
  24.  
  25. return true;
  26. } else {
  27. return false;
  28. }
  29. }
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: send email

 
0
  #2
Aug 13th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 381
Reputation: langsor is an unknown quantity at this point 
Solved Threads: 33
langsor langsor is offline Offline
Posting Whiz

Re: send email

 
0
  #3
Aug 13th, 2008
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
Last edited by langsor; Aug 13th, 2008 at 1:42 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: send email

 
0
  #4
Aug 13th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 381
Reputation: langsor is an unknown quantity at this point 
Solved Threads: 33
langsor langsor is offline Offline
Posting Whiz

Re: send email

 
0
  #5
Aug 13th, 2008
Thanks R0bb0b,

I must be feeling paranoid today.. :-\
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 475 | Replies: 4
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC