Solved

Sending mail through jquery.contactable - mail.php

Posted on 2011-03-20
4
915 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now