Solved

Sending mail through jquery.contactable - mail.php

Posted on 2011-03-20
4
923 Views
Last Modified: 2012-05-11
I have a cool jquery contact form (quick contact) that flys out from the side of my website.  I really like the look and feel but can't get it to actually send an email.  The code references a mail.php and I have placed it on a newly acquired virtual server from GoDaddy(Windows Server 2008 R2).  Is there a setting I have to put in place on the server to process a PHP page.  I have changed the settings in my file to the correct info as far as host server, username and password however, when I click the send it triggers the "please wait.." text and a progressbar.  It spends endlessly and never completes.  I cannot find any error message anywhere.  FYI: This functionality also fails in my development environment.(windows 7)

I believe I have IIS 7 on the server

view example:  www.crimsonsoftware.co

Thanks for any suggestions


<?php
 require_once "Mail.php";

 $from = "Mike Wilson <mike@xxxxxx.com>";
 $to = "Mike Wilson <xxxxxx@charter.net>";
 $subject = "Hi!";
 $body = "Hi,\n\nHow are you?";
 
 $host = "mail.xxxxxx.com";
 $username = "xxxxxxx";  
 $password = "xxxxxx";
 
 $headers = array ('From' => $from,
   'To' => $to,
   'Subject' => $subject);
 $smtp = Mail::factory('smtp',
   array ('host' => $host,
     'auth' => true,
     'username' => $username,
     'password' => $password));
 
 $mail = $smtp->send($to, $headers, $body);
 
 if (PEAR::isError($mail)) {
   echo("<p>" . $mail->getMessage() . "</p>");
  } else {
   echo("<p>Message successfully sent!</p>");
  }
 ?>

Open in new window

0
Comment
Question by:mikewilson55
  • 3
4 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 35178547
Here is an interesting discussion

http://forums.devarticles.com/web-hosting-45/php-mail-function-not-working-with-godaddy-com-90663.html

Sorry about the spam in the middle - not my site.
0
 

Author Comment

by:mikewilson55
ID: 35198546
Did not have PHP set up on new Windows Server 2008 R2.  I am going to get this installed properly and then try my Quick Contact form again.  I assume the mail.php will begin performing as expected but must test this afternoon.
0
 

Author Comment

by:mikewilson55
ID: 35211262
I have PHP installed and confirmed by navigating to http://localhost/phpinfo.php but still no luck sending an email using the mail.php.

Does anyone have an example of settings?

how does the mail.php in the jquery contable interact with the main php.ini.

Is it the php.ini I need to be setting smtp info in?

Where should the mail.php file be placed -
root of website?  
root of webserver?
main php folder on c-drive?

0
 

Author Closing Comment

by:mikewilson55
ID: 36142963
not a complete solution but gave me direction
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question