Jump to content

First time installer - having trouble with mail, did i do something wrong?


Recommended Posts

Ok, this will be a somewhat long post, but please bear with me.

 

Hi guys,

 

Ive been having a lot of trouble with a server that my jobs websites are hosted on. I have never used a server before...and didn't even know php was something you installed

 

I did manage to install it however...

 

and after a week of googling and tutorials up to my eyeballs, i now know that the server os is WINDOWS SERVER 2003, i have IIS 6, and i installed php 5 the other day. Its not a mail server, however it does have a virtual SMTP server available, but im not sure i know how to use it.

 

Heres the problem though, i have tried several contact forms, all online, and even written my own, they all work on my own private hosting, but when i run them on this server, either locally or from a browser on my computer, they've been returning errors.

 

After another week of googling and tutorials, I've managed to eliminate all of the errors down to authentication.

 

The test code:

<?php 
mail('email@domain.com', 'Test Subject', 'Test Message');
?>

(removed my email from the above code)

 

the test URL:

http://atcpresents.com/mail/mailtest.php

 

But the link says it can not be authenticated. First off, from what i read, you don't need authentication for this, is that correct? and secondly, this is just for a contact form on the "Contact Us" page, and i don't care if it ends up in the spam folder, because all of these emails are being sent to a specific email set up just for this form.

 

Anyway, my question is, Is there a way to turn off authentication, either thru php, or thru the PHP.ini file on my server, or do i turn it off from my server itself? can anyone help me fix this issue?

 

I thought it was something in PHP.ini, but this is all i could find that references mail:

[mail function]
; For Win32 only.
SMTP = <removed>
smtp_port = 25

; For Win32 only
sendmail_from = <removed>

(removed info) the rest is for unix platforms so im really stuck :(

 

Someone suggested i use PEAR, but i downloaded it and there were just a folder full of files, so i figured they went into the PHP5/ directory, but then i got these errors:

 

Warning: Mail_smtp::include_once(Net/SMTP.php) [mail-smtp.include-once]: failed to open stream: No such file or directory in C:php5PEARMailsmtp.php on line 311

Warning: Mail_smtp::include_once() [function.include]: Failed opening 'Net/SMTP.php' for inclusion (include_path='.;C:php5pear') in C:php5PEARMailsmtp.php on line 311

Fatal error: Class 'Net_SMTP' not found in C:php5PEARMailsmtp.php on line 312

 

Which is strange, because i ran it on the server as well, AND checked the directory, and the files were there...not missing like the errors seem to point out.

 

I then proceeded to download the PEAR Package: Net_SMTP and replaced the "SMTP.php in the PEAR directory with the packaged one, and then the errors went away, however now im getting a blank screen, and still no mail.

 

The PEAR code:

<?php
require_once "Mail.php";

$from = "American Theatre Channel <noreply@atcpresents.com>";
$to = "somebody <seqoiagdirector@aol.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";

$host = " smtp.1and1.com";
$username = "<removed>";
$password = "<removed>";

$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>");
}
?>

 

the PEAR test url:

http://atcpresents.com/mail/8/pear.php

 

Found this on my web server providers site, not sure if it means anything:

==================================================================

Please note: To send e-mail using the SMTP-Server, activate SMTP Authentication. Please do not use the Secure Password Authentication (SPA) option. Optionally, port 587 can also be used in addition to the default port (25) RFC 2476.

==================================================================

 

How do i do that?

 

Im extremely lost, and id appreciate ANY direction you guys can give me, ???

Thanks guys.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.