| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Mar 2006 Location: Wigan, UK
Posts: 522
![]() | Np$ 50 for resolving issue. keep getting this error message: Warning: mail(): SMTP server response: 554 Error: no valid recipients in e:\domains\c\cheap-florida-holiday.com\user\htdocs\email.php on line 25 anyone help me? Np$ 50 for resolving issue. cheers |
| |
| | #5 (permalink) |
| New Member Join Date: May 2006
Posts: 2
![]() | Can u send me the email.php , the error code seem like authentication issue. my email is andychang21@gmail.com |
| |
| | THREAD STARTER #6 (permalink) |
| NamePros Regular Join Date: Mar 2006 Location: Wigan, UK
Posts: 522
![]() | hi, ths is the email.php <? require_once("conn.php"); require_once("includes.php"); //get the agent info $q1 = "select * from re2_agents where AgentID = '$_GET[AgentID]' "; $r1 = mysql_query($q1) or die(mysql_error()); $a1 = mysql_fetch_array($r1); if(isset($_POST[s1])) { $to = $a1[email]; $subject = $_POST[subject]; $message = $_POST[message]; $message .= "\n\nProperty:\n$site_url/info.php?id=$_GET[ListingID]\n\n"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\n"; $headers .= "Content-Transfer-Encoding: 8bit\n"; $headers .= "From: $_POST[u_name] <$_POST[u_email]>\n"; $headers .= "X-Priority: 1\n"; $headers .= "X-MSMail-Priority: High\n"; $headers .= "X-Mailer: PHP/" . phpversion()."\n"; mail($to, $subject, $message, $headers); ????: NamePros.com http://www.namepros.com/programming/197931-np-50-for-resolving-issue.html $thankyou = "<center><b><br><br><br>Thank you for your message!<br><br><a class=RedLink href=\"$site_url/info.php?id=$_GET[ListingID]\">back to the property details</a></center>"; //get the templates require_once("templates/HeaderTemplate.php"); require_once("templates/EmailThankyouTemplate.php"); require_once("templates/FooterTemplate.php"); } $AgentName = "$a1[FirstName] $a1[LastName]"; if(!empty($_GET[ListingID])) { $SubjectLine = "Property ID $_GET[ListingID]"; } //get the templates require_once("templates/HeaderTemplate.php"); require_once("templates/EmailTemplate.php"); require_once("templates/FooterTemplate.php"); ?> this is the emailtemplate.php what the above code request. <script> function CheckMail() { if(document.je.u_name.value=="") { alert('Enter your name, please!'); document.je.u_name.focus(); return false; } if(document.je.u_email.value=="") { alert('Enter your email, please!'); document.je.u_email.focus(); return false; } if(document.je.subject.value=="") { alert('Enter the subject, please!'); document.je.subject.focus(); return false; } ????: NamePros.com http://www.namepros.com/showthread.php?t=197931 if(document.je.message.value=="") { alert('Enter your message, please!'); document.je.message.focus(); return false; } } </script> <br><br> <form method=post onsubmit="return CheckMail();" name=je> <table width=340 align=center border=0> <caption align=center><span style="font-size:11; font-family:verdana; color:black; font-weight:bold">Use this form to contact <?=$AgentName?></span></caption> <tr> <td>Name:</td> <td><input type=text name="u_name" size=42 class="mtext"></td> </tr> <tr> <td>Email:</td> <td><input type=text name=u_email size=42 class="mtext"></td> </tr> <tr> <td>Subject:</td> <td><input type=text name=subject size=42 class="mtext" value="<?=$SubjectLine?>"></td> </tr> <tr> <td valign=top>Message:</td> <td><textarea rows=6 cols=41 name=message class="mtext"><?=$_POST[message]?></textarea></td> </tr> <tr> <td> </td> <td> <input type=submit name=s1 value="Send" class="sub1"> </td> </tr> </table> </form>
Last edited by fried-chicken; 05-17-2006 at 04:06 AM.
|
| |
| | #7 (permalink) |
| Senior Member Join Date: Nov 2005 Location: Hong Kong
Posts: 1,154
![]() ![]() ![]() | it is possible that the email is not valid. Try echoing out $q1, and put it into phpmyadmin to see if anything gets returned. If nothing gets returned, it's your query's problem, and not the mail code or anything.
__________________ If you're as bored as I am, join me in Fallensword! (I swear, this game is actually pretty fun :P) |
| |
| | #9 (permalink) |
| Senior Member Join Date: Nov 2005 Location: Hong Kong
Posts: 1,154
![]() ![]() ![]() | ok, never mind, let me try a different approach. After $a1 = mysql_fetch_array($r1);, but echo $a1[email]; if it returns a blank, there's a problem with your query. if it returns an email, I'll have to think a little bit longer. is this ok with you?
__________________ If you're as bored as I am, join me in Fallensword! (I swear, this game is actually pretty fun :P) |
| |
| | #10 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,552
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Most likely the E-mail you are trying to send to is not set/invalid. Echo it to check. Also use quotes when accessing array elements: $to = $a1[email]; => $to = $a1["email"];
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | #11 (permalink) |
| Senior Member Join Date: Nov 2005 Location: Hong Kong
Posts: 1,154
![]() ![]() ![]() | ^ yes, I was also about to suggest that. I normally use single quotes though, ' .
__________________ If you're as bored as I am, join me in Fallensword! (I swear, this game is actually pretty fun :P) |
| |
| | THREAD STARTER #12 (permalink) |
| NamePros Regular Join Date: Mar 2006 Location: Wigan, UK
Posts: 522
![]() | EDITED like suggestions no joy. did i put it in the right place? ------------------------------- <? require_once("conn.php"); require_once("includes.php"); //get the agent info $q1 = "select * from re2_agents where AgentID = '$_GET[AgentID]' "; $r1 = mysql_query($q1) or die(mysql_error()); $a1 = mysql_fetch_array($r1); echo $a1[email]; if(isset($_POST[s1])) { $to = $a1[email]; $subject = $_POST[subject]; $message = $_POST[message]; $message .= "\n\nProperty:\n$site_url/info.php?id=$_GET[ListingID]\n\n"; $headers = "MIME-Version: 1.0\n"; ????: NamePros.com http://www.namepros.com/showthread.php?t=197931 $headers .= "Content-type: text/plain; charset=iso-8859-1\n"; $headers .= "Content-Transfer-Encoding: 8bit\n"; $headers .= "From: $_POST[u_name] <$_POST[u_email]>\n"; $headers .= "X-Priority: 1\n"; $headers .= "X-MSMail-Priority: High\n"; $headers .= "X-Mailer: PHP/" . phpversion()."\n"; mail($to, $subject, $message, $headers); $thankyou = "<center><b><br><br><br>Thank you for your message!<br><br><a class=RedLink href=\"$site_url/info.php?id=$_GET[ListingID]\">back to the property details</a></center>"; ----------------- tried with and with out " " and ' ' around [mail] |
| |
| | #13 (permalink) |
| Senior Member Join Date: Nov 2005 Location: Hong Kong
Posts: 1,154
![]() ![]() ![]() | did you do '[mail]' or ['mail']? o yea, and what did it output? anything new?
__________________ If you're as bored as I am, join me in Fallensword! (I swear, this game is actually pretty fun :P) |
| |
| | THREAD STARTER #14 (permalink) |
| NamePros Regular Join Date: Mar 2006 Location: Wigan, UK
Posts: 522
![]() | hi i did ['mail'] it change to Warning: mail(): SMTP server response: 554 Error: no valid recipients in e:\domains\c\cheap-florida-holiday.com\user\htdocs\email.php on line 27 the line error moved dome to line 27 |
| |
| | #15 (permalink) |
| Senior Member Join Date: Nov 2005 Location: Hong Kong
Posts: 1,154
![]() ![]() ![]() | ok, yea, that didn't change... just to make sure, comment out the line that says mail($to, ...etc...). just put // in front of it, and change echo $a1[email]; to echo $a1['email'].
__________________ If you're as bored as I am, join me in Fallensword! (I swear, this game is actually pretty fun :P) |
| |
| | #16 (permalink) | ||||
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
where you have PHP Code: PHP Code: | ||||
| |
| | THREAD STARTER #17 (permalink) |
| NamePros Regular Join Date: Mar 2006 Location: Wigan, UK
Posts: 522
![]() | hi, done the changes you both said. the change suggested by "poordoogie" ------------------------------------------ now as soon as you go on to the contacts page it reads "something wrong" in the top right hand corner. without trying to use the formtomail. once used it come up with a similar error as before. the change suggested by "anzchong91" ????: NamePros.com http://www.namepros.com/showthread.php?t=197931 --------------------------------------- gives "Parse error: parse error, unexpected T_IF, expecting ',' or ';' in e:\domains\c\cheap-florida-holiday.com\user\htdocs\email.php on line 13" by going to the contact page and not trying to use the formtomail. nothing else loads on the page. script still on "anzchong91" suggestion, result can be seen at www.cheap-florida-holiday.com/email.php |
| |
| | #18 (permalink) |
| NamePros Regular Join Date: Oct 2005 Location: Milford MA
Posts: 692
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: |
| |
| | #22 (permalink) |
| Senior Member Join Date: Mar 2005
Posts: 4,948
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Made a few changes: PHP Code: |
| |
| | #23 (permalink) | ||||
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
so if I were to do @mysql_query($sql) it wouldn't come up with lines of unintelligible text about me having an "error in [my] mysql syntax"?????: NamePros.com http://www.namepros.com/showthread.php?t=197931 Great, thanks. Back to the thread Tom | ||||
| |
| | THREAD STARTER #24 (permalink) |
| NamePros Regular Join Date: Mar 2006 Location: Wigan, UK
Posts: 522
![]() | i keep getting this error now on page load. Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in e:\domains\c\cheap-florida-holiday.com\user\htdocs\email.php on line 33 |
| |