Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

w2ksp4.exe, WwwxxXdbf, procmail "FROM_MAILER" patch, Use of assignment to $[ is deprecated at /usr/local/sbin/apxs line 86. , wwwxxx vim, mysql closing table and opening table, 800c5000, setgid operation not permitted, pciehp: acpi_pciehprm on IBM, WWWXXX.DBF

Links

XODOX
Impressum

#1: Re: PHP Email Question

Posted on 2010-10-01 00:37:40 by Ravi Menon

On Wed, Sep 29, 2010 at 1:37 PM, Joe Jackson <priorybar@googlemail.com> wro=
te:
> Hi
>
> I am trying the following snippet as Bostjan=A0 suggested, and an email i=
s
> getting sent when I submit the form however in the body of the email I am
> getting none of the form data in the body of the email.=A0 All I am getti=
ng is
> the letter 'z' ?=A0 Also in the from field of the email this is showing a=
s my
> email address and not the email address of the user who has sent the form
>
> Any ideas on where I am going wrong with this snippet?=A0 Any advice woul=
d be
> much appreciated
>
> $msgContent =3D "Name: ". $values['name'] ."\n";
> $msgContent .=3D "Address: ". $values['address'] ."\n";
> $msgContent .=3D "Telephone: ". $values['telephone'] ."\n";
> $msgContent .=3D "Email Address: ". $values['emailaddress'] ."\n";
> $msgContent .=3D "Message: ". $values['message'] ."\n";
>
> function ProcessForm($values)
> {
>   =A0 mail('myemail:domain.com', 'Website Enquiry', $msgContent, "Fro=
m:
> \"{$values['name']}\" <{$values['emailaddress']}>");
>
>      // Replace with actual page or redirect :P
>   =A0 echo "<html><head><title>Thank you!</title></head><body>Thank
> you!</body></html>";

Not sure if it it is a typo above, are you actually passing
$msgContent in the function above? If it is a global variable, you
would need to add a 'global' declaration:

function ProcessForm($values)
{
global $msgContent;

mail('myemail:domain.com', 'Website Enquiry', $msgContent, "From:
\"{$values['name']}\" <{$values['emailaddress']}>\r\n");
..
..
..
}

Also try adding CRLF sequence at the end of the header line as shown above.

Ravi

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message

#2: Re: PHP Email Question

Posted on 2010-10-01 17:06:19 by kranthi

I cant see why you are getting the letter 'z' (assuming $msgContent
was referenced properly) . Complete code will be helpful to debug the
problem.

Also, Heredoc syntax will be more helpful in your situation. And usage
of global keyword is strongly discouraged in favor of $GLOBALS
superglobal array

http://php.net/GLOBALS
http://php.net/heredoc

Kranthi.
http://goo.gl/e6t3

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message