hello when my system send email to my clients they get it with the title that I set. how do I set the SENDER? for now its look like that: Here are my properties: $from= "MIME-Version: 1.0 \r\n"; $from.= "Content-type: text/html; charset=windows-1255 \r\n"; $from .= "From: $sender \r\n"; $sender= $site_name; $subject= 'New Reply in ticket title - '.$title; $message = "some text" mail($site_email, $subject, nl2br($message), $from); PHP: Im using PHP Thank you in advanced
PHP read left to right, top to bottom. If you're setting a variable after it's called, it can't use it. Move the $sender = above the 'From: $sender" statement.
Can you rephrase your question? What title is being sent? Do you mean this? $sender= $site_name; PHP:
It should be mail(to, subject, message, headers) //remove $from .= "From: $sender ..... //change to $sender = "From: $sender \r\n"; PHP:
Maybe it would be easier if you would use htmlMimeMail. $m = new htmlMimeMail(); $m->setHTMLCharset ("UTF-8"); $m->setHeadCharset ("UTF-8"); $m->setTextCharset ("UTF-8"); $m->setSubject ($subject); $m->setHtml ($body); $m->setFrom ('your@email.si'); It's way eaiser then creating and concating together proper headers.
You would need to execute the object once the parameters are set: $m->send(); PHP: PHP has automatic garbage collection so you need not do anything with the object after this point, however if you want to dispose of it you can set it to null or use unset()
OK, I tried it and giot this error: Fatal error: Class 'htmlMimeMail' not found in /home/pelegisr/public_html/sites/submit_tkt.php on line 224 line 224 is: $m = new htmlMimeMail(); why is that?
You don't have the class present as you don't have the library. This is not a core library within PHP, it's a third party's.