 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
djbranson
Joined: 29 Oct 2006 Posts: 2 Location: Lubbock, Texas
|
Posted: Wed Nov 01, 2006 6:28 am Post subject: What Am I Missing - Using Windows Web & Linux SMTP Serve |
|
|
I have a client-side html form calling a php script in that same directory, which is supposed to send an SMTP-authenticated email message. The php has:
<?php
require_once "Mail.php";
$first_name = $_REQUEST['first_name'];
$last_name = $_REQUEST['last_name'];
$email = $_REQUEST['email'];
$zip_code = $_REQUEST['zip_code'];
$from = $email;
$to = "me@mydomain.com";
$subject = "My Test Email";
$body = $first_name . " " . $last_name . "\n" . $email . "\n" . $zip_code;
$host = "mail.mysmtphost.com";
$username = "myusername";
$password = "mypassword";
$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! Press 'Back'</p>");
}
?>
When my html form gets the data and calls the php script, I get the following messages:
Warning: require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory in C:\...\m_request.php on line 2
Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.;C:\php5\pear') in C:\...\m_request.php on line 2
Any suggestions you might have would be appreciated.
*** Added Note: I tried the form & php script using the simple Mail() function and it worked perfectly with my Linux Mail Server from my Windows XP-based development computer WITHOUT SMTP, but when I moved the webpage and script over to my Windows 2000 Web Server, I got the message that SMTP was required to work with that same Linux Mail Server... that is a bit confusing to me. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|