CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Send Email

Print topic Send  topic

Author Message
marcos
Posted: 09/14/2005, 10:55 PM

Im trying the "Add Code in the After Insert Event to Send Emails" code, but I found someting strange in it.

This line: $headers .= "Content-Type: text/html";

if I leave the period "." afeter $headers, it sends the body in text format, if I remove it, then it doesnt sends the from_name & from_email, instead, it replaced it with my domain (mydomain.com) and my mailserver name (mail5.mydomain.com), ...I use diferent servers for mail and web.

How can I fix this? whats wrong?
mrachow


Posts: 509
Posted: 09/14/2005, 11:08 PM

.= will append the new string to previous content of $header.
So removing dot in front of = will remove all header information and by that some default values from php.ini will be used.

I'm not sure about the content of your mail body.
Does it contain HTML tags the receiver will see?
_________________
Best regards,
Michael
View profile  Send private message
marcos
Posted: 09/15/2005, 3:41 PM

Yes, <br></br> "line break", to separate paragraf's, this is my entire code:

$from_name =$sendcomment->autor->GetValue();
$from_email =$sendcomment->email->GetValue();
$to_email="support@mysite.com; student_affairs@mysite.com";


$headers = "From: ".$from_name."<".$from_email.">;";
$headers .= "Content-Type: text/html";
$subject = "Students Comments";
$message = "About: ".$sendcomment->title->GetValue().
" <br> </br> ".$sendcomment->message->GetValue().
" <br> </br> "."send from: ".$sendcomment->ip_num->GetValue();

If I delete the "." before the "=" the line break's works, but the $from_email & $to_email dont, If I leave it, the line break's dontworks, and so on....

How can I include a CC and BCC lines? I tried with cc_email & bcc_email, but it sends error
DonB
Posted: 09/15/2005, 5:28 PM

You need to use "\r\n" as a linebreak within substrings in the header (which
is where you specify the CC and/or BCC recipients). The HTML <BR> is not
gong to work there because it's not destined for a web browser that 'knows'
HTML markup.. If the header has text/html specified, then HTML markup is ok
IN THE BODY of the message.

--
DonB

http://www.gotodon.com/ccbth


"marcos" <marcos@forum.codecharge> wrote in message
news:54329f8a7c2cf7@news.codecharge.com...
> Yes, <br></br> "line break", to separate paragraf's, this is my entire
code:
>
> $from_name =$sendcomment->autor->GetValue();
> $from_email =$sendcomment->email->GetValue();
> $to_email="support@mysite.com; student_affairs@mysite.com";
>
>
> $headers = "From: ".$from_name."<".$from_email.">;";
> $headers .= "Content-Type: text/html";
> $subject = "Students Comments";
> $message = "About: ".$sendcomment->title->GetValue().
> " <br> </br> ".$sendcomment->message->GetValue().
> " <br> </br> "."send from: ".$sendcomment->ip_num->GetValue();
>
> If I delete the "." before the "=" the line break's works, but the
$from_email
> & $to_email dont, If I leave it, the line break's dontworks, and so on....
>
> How can I include a CC and BCC lines? I tried with cc_email &
bcc_email, but
> it sends error
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

marcos
Posted: 09/18/2005, 2:13 AM

did you mean usisng <n></n> and <r></r>

it doesnt work, Im shure Im doing it wrong... :-/

can you please be more specific... surry my ignorance...
DonB
Posted: 09/18/2005, 6:47 PM

No, use the 'escape' symbol '\'. Follow it with the letter that designates
the RETURN or NEWLINE, 'r' or 'n'.

The exact string to use is '\r\n' (excluding my quotes, that is). These are
non-html entities, so no brackets.

--
DonB

http://www.gotodon.com/ccbth


"marcos" <marcos@forum.codecharge> wrote in message
news:5432d2fd1552d2@news.codecharge.com...
> did you mean usisng <n></n> and <r></r>
>
> it doesnt work, Im shure Im doing it wrong... :-/
>
> can you please be more specific... surry my ignorance...
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.