logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 08-16-2009, 03:30 PM   #1
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default Problem with mail form...

Hey guys, Can someone please tell me what's wrong with this form? It sends e-mails back but it's not displaying any info. Thanks.

PHP Code:
 <?php 
// Where to redirect after form is processed. 
$url 'http://www.car4students.com/contact.php'

require(
"class.phpmailer.php"); 
$mail = new PHPMailer();$mail = new PHPMailer(); 
$mail->CharSet ="utf-8"// You can adjust the Charset according to your language 
$mail->IsSMTP(); 
$mail->Host "mail.car4students.com"
$mail->From="mail@car4students.com"//REMEMBER, this MUST be same as your authorization email address above. 
$mail->FromName="Contact Page"
$mail->SMTPAuth true
$mail->Username "info@car4students.com"
$mail->Password "pass"

$mail->AddAddress("info@car4students.com"); 
$mail->Subject "Subject"
$mail->message "message"
$mail->email "email"

include_once 
$_SERVER['DOCUMENT'] .'d:\hosting\member/car4students\c4site\securimage\securimage.php'

$securimage = new Securimage(); 

if (
$securimage->check($_POST['captcha_code']) == false) { 
  
// the code was incorrect 
  // handle the error accordingly with your other error checking 

  // or you can do something really basic like this 
  
die('Oops. The code you entered was incorrect.  Please go back and try again.'); 


if(!
$mail->Send()) 

   echo 
"Error sending: " $mail->ErrorInfo;; 

else 

   echo 
"E-mail sent"
   echo 
'<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">'
}
?>
gigiloumill is offline   Reply With Quote
Old 08-17-2009, 04:16 PM   #2
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default

anybody....?
gigiloumill is offline   Reply With Quote
Old 08-17-2009, 05:27 PM   #3
mangofreak
mangofreak's Avatar
 
Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444
Default

what kind of error do you receive?

is the following the right path?
d:\hosting\member/car4students\c4site\securimage\securimage.php
__________________
J.
DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu
mangofreak is offline   Reply With Quote
Old 08-17-2009, 06:15 PM   #4
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default

Quote:
Originally Posted by mangofreak View Post
what kind of error do you receive?

is the following the right path?
d:\hosting\member/car4students\c4site\securimage\securimage.php
Yes. I redid the script and now I'm getting this error:

Quote:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\hosting\member\car4students\c4site\testing.php on line 12
Message delivery failed
Here's the script:
PHP Code:
<?php
$to 
"info@car4students.com";
$subject "Hi!";
$body "Hi,\n\nHow are you?";
if (
mail($to$subject$body)) {
  echo(
"<p>Message successfully sent!</p>");
 } else {
  echo(
"<p>Message delivery failed...</p>");
 }
?>
<?php

$mail 
= new PHPMailer();$mail = new PHPMailer();
$mail->CharSet ="utf-8"// You can adjust the Charset according to your language
$mail->IsSMTP();
$mail->Host "mail.car4students.com";
$mail->From="sales@car4students.com"//REMEMBER, this MUST be same as your authorization email address above.
$mail->FromName="My site's mailer";
$mail->SMTPAuth true;
$mail->Username "info@car4students.com";
$mail->Password "pass";
?>
gigiloumill is offline   Reply With Quote
Old 08-17-2009, 07:23 PM   #5
mangofreak
mangofreak's Avatar
 
Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444
Default

Quote:
Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
Did you setup your smtp?

Google this: Failed to connect to mailserver at "localhost" port 25

and you'll find many possible solutions.

Is this your first time trying to send email this way? were you successful before?

What system are you using? I have Ubuntu running and Apache-php-mysql. Are you using windows?
__________________
J.
DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu
mangofreak is offline   Reply With Quote
Old 08-17-2009, 07:31 PM   #6
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default

I'm using win. I have PHP -mysql. I'm using a new remote server that requires SMTP auth to send e-mail. I never had this problem before. I'm not testing this on my local server, I uploaded files to remote server and testing live. I can't seem to get info from contact form into inbox. I'm seeing an email but it's empty.
gigiloumill is offline   Reply With Quote
Old 08-17-2009, 08:40 PM   #7
mangofreak
mangofreak's Avatar
 
Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444
Default

How did you generate the mail processing code? what was the application or did you hard code it?

Did you use SmarterMail? if so: check this out:

http://www.smartertools.com/forums/p/12493/26794.aspx
__________________
J.
DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu

Last edited by mangofreak; 08-17-2009 at 08:48 PM..
mangofreak is offline   Reply With Quote
Old 08-17-2009, 09:43 PM   #8
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default

Thanks mango but, I figured it out. I needed to include all fields posting.
gigiloumill is offline   Reply With Quote
Old 08-18-2009, 12:38 AM   #9
mangofreak
mangofreak's Avatar
 
Join Date: Jan 2006
Location: Toronto-Canada
Posts: 444
Default

that's great. Cheers.
__________________
J.
DW | FW | HTML | CSS | ASP | some PHP | Windows | Ubuntu
mangofreak is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:03 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com