From: "Joey Hendricks" on 13 Jul 2010 09:56 Hello, I have been working on a birtday invite program. The form takes 10 names and 10 email addresses. I think the problem is the $to variable in my function. I get this warning-Warning: mail() [function.mail]: SMTP server response: 550 5.5.0 <f> domain name required in..... Could someone help me with this my email is j.hendricksjr(a)comcast.net Thank you so very much! This is my code- <?php function mail_message($data_array, $template_file, $deadline_str) { $email_message = file_get_contents($template_file); $email_message = str_replace("#DEADLINE#", $deadline_str, $email_message); $email_message = str_replace("#DATE#", date("F d, Y h:i a"), $email_message); $email_message = str_replace("#NAME#", $data_array['name'], $email_message); //I tried many things for this $to variable //If I put in an email address it works $to=$mymail; $from='j.hendricksjr(a)comcast.net'; $email_subject='Bubs Birthday'; mail($to, $email_subject, $email_message, "From: ".$from); } if(empty($_GET['name0']) && (empty($_GET['email0']))) { $query_string = $_SERVER['QUERY_STRING']; $url = "invite_form.php?".$query_string."&error=1"; header("Location: ".$url); exit(); } for($i=0;$i<=9;$i++) { if(!empty($_GET[name.$i]) && (empty($_GET[email.$i]))) { $query_string = $_SERVER['QUERY_STRING']; $url = "invite_form.php?".$query_string."&error=2"; header("Location: ".$url); exit(); } } for($i=0;$i<=9;$i++) { if(empty($_GET[name.$i]) && (!empty($_GET[email.$i]))) { $query_string = $_SERVER['QUERY_STRING']; $url = "invite_form.php?".$query_string."&error=3"; header("Location: ".$url); exit(); } } function goodmail($myemail) { $goodemail="^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$"; if(!ereg($goodemail, $myemail)) { $query_string = $_SERVER['QUERY_STRING']; $url = "invite_form.php?".$query_string."&error=4"; header("Location: ".$url); exit(); } return $myemail; } for($i=0;$i<=9;$i++) { if(!empty($_GET[email.$i])) { $mail=$_GET[email.$i]; goodmail($mail); } } extract($_GET, EXTR_PREFIX_SAME, "get"); for($i=0;$i<=9;$i++) { $deadline_array = getdate(); $deadline_day = $deadline_array['mday'] + 7; $deadline_stamp = mktime($deadline_array['hours'],$deadline_array['minutes'],$deadline_array['seconds'], $deadline_array['mon'],$deadline_day,$deadline_array['year']); $deadline_str = date("F d, Y", $deadline_stamp); if(!empty($_GET[email.$i])) { mail_message($_GET[email.$i], "email_template.txt", $deadline_str); //mail($to, $email_subject, $email_message, "From: ".$from); } }
From: Richard Quadling on 13 Jul 2010 10:02 On 13 July 2010 14:56, Joey Hendricks <j.hendricksjr(a)comcast.net> wrote: > Hello, > Â I have been working on a birtday invite program. The form takes 10 names and 10 email addresses. I think the problem is the $to variable in my function. I get this warning-Warning: mail() [function.mail]: SMTP server response: 550 5.5.0 <f> domain name required in..... > Could someone help me with this my email is j.hendricksjr(a)comcast.net Thank you so very much! <?php mail(' j.hendricksjr(a)comcast.net', 'Test email', 'This is a test email'); ?> and I get the following entry in my PHP's mail.log ... mail() on [-:2]: To: j.hendricksjr(a)comcast.net -- Headers: Pretty simple stuff. http://docs.php.net/manual/en/function.mail.php Regards, Richard.
From: Carlos Sura on 13 Jul 2010 11:48 Let me get this right... $mymail // If you put an email adress it works, right. You are calling variable $mymail... But, what does contain that var? You are calling $mymail, there has to be a database, or something of those 10 mails you said. -If i'm getting you the point right- If not, my mistake. Or you might use something like this: <?php // mail list $to = 'yourmail1(a)example.com' . ', '; $to .= 'yourmail2(a)example.com'; If my answer is wrong for you. Plrease reffer to: http://docs.php.net/manual/en/function.mail.php -as Richard said.- > From: rquadling(a)gmail.com > Date: Tue, 13 Jul 2010 15:02:14 +0100 > To: j.hendricksjr(a)comcast.net > CC: php-general(a)lists.php.net > Subject: Re: [PHP] Help with template file and email > > On 13 July 2010 14:56, Joey Hendricks <j.hendricksjr(a)comcast.net> wrote: > > Hello, > > I have been working on a birtday invite program. The form takes 10 names and 10 email addresses. I think the problem is the $to variable in my function. I get this warning-Warning: mail() [function.mail]: SMTP server response: 550 5.5.0 <f> domain name required in..... > > Could someone help me with this my email is j.hendricksjr(a)comcast.net Thank you so very much! > > <?php > mail(' j.hendricksjr(a)comcast.net', 'Test email', 'This is a test email'); > ?> > > and I get the following entry in my PHP's mail.log ... > > mail() on [-:2]: To: j.hendricksjr(a)comcast.net -- Headers: > > Pretty simple stuff. > > http://docs.php.net/manual/en/function.mail.php > > Regards, > > Richard. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > _________________________________________________________________ http://clk.atdmt.com/UKM/go/197222280/direct/01/ Do you have a story that started on Hotmail? Tell us now
From: Carlos Sura on 26 Jul 2010 13:17 Hello Joey, No problem, I'm glad you got it working now. Any other question. Use php-list. Regards, Carlos Sura. From: j.hendricksjr(a)comcast.net To: carlos_sura(a)hotmail.com Subject: Re: [PHP] Help with template file and email Date: Sat, 24 Jul 2010 08:29:03 -0500 Hi Carlos, I wanted to thank you for all your help!! In the function I had to use a foreach() to get the email. Then put the $_GET['email'] in when I called the function. Finally got it! Thank you for your help!! Joey. ----- Original Message ----- From: Carlos Sura To: j.hendricksjr(a)comcast.net Cc: php-general(a)lists.php.net Sent: Tuesday, July 13, 2010 10:48 AM Subject: RE: [PHP] Help with template file and email Let me get this right... $mymail // If you put an email adress it works, right. You are calling variable $mymail... But, what does contain that var? You are calling $mymail, there has to be a database, or something of those 10 mails you said. -If i'm getting you the point right- If not, my mistake. Or you might use something like this: <?php // mail list $to = 'yourmail1(a)example.com' . ', '; $to .= 'yourmail2(a)example.com'; If my answer is wrong for you. Plrease reffer to: http://docs.php.net/manual/en/function.mail.php -as Richard said.- > From: rquadling(a)gmail.com > Date: Tue, 13 Jul 2010 15:02:14 +0100 > To: j.hendricksjr(a)comcast.net > CC: php-general(a)lists.php.net > Subject: Re: [PHP] Help with template file and email > > On 13 July 2010 14:56, Joey Hendricks <j.hendricksjr(a)comcast.net> wrote: > > Hello, > > I have been working on a birtday invite program. The form takes 10 names and 10 email addresses. I think the problem is the $to variable in my function. I get this warning-Warning: mail() [function.mail]: SMTP server response: 550 5.5.0 <f> domain name required in..... > > Could someone help me with this my email is j.hendricksjr(a)comcast.net Thank you so very much! > > <?php > mail(' j.hendricksjr(a)comcast.net', 'Test email', 'This is a test email'); > ?> > > and I get the following entry in my PHP's mail.log ... > > mail() on [-:2]: To: j.hendricksjr(a)comcast.net -- Headers: > > Pretty simple stuff. > > http://docs.php.net/manual/en/function.mail.php > > Regards, > > Richard. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > Get a new e-mail account with Hotmail - Free. Sign-up now. _________________________________________________________________ http://clk.atdmt.com/UKM/go/197222280/direct/01/ Do you have a story that started on Hotmail? Tell us now
|
Pages: 1 Prev: Serial Numbers Next: Posting values of dynamically generated text fields at a time |