sendmail guide

Problems with the Windows version of XAMPP, questions, comments, and anything related.

sendmail guide

Postby Hunter » 18. September 2005 00:46

Hi. I wounder if there is any good "sendmail" guide. The once that in "sendmail" folder(in xampp) is very short. Dont understand the following:

1. the files should be put in: usr\lib\ . Is this something I should get somewhere or just create?

2. Apperently I need an unix application installed. What is this and where do I get it?

3. Need smtp server also I think. Where do I find this one?

Thanks in advance!!
Hunter
 
Posts: 32
Joined: 03. September 2005 16:29

Postby Wiedmann » 18. September 2005 01:03

1. the files should be put in: usr\lib\ . Is this something I should get somewhere or just create?
2. Apperently I need an unix application installed. What is this and where do I get it?

This is from the "ReadMe.html"? You can forget this file, but we must include it unchanged in XAMPP (license).

3. Need smtp server also I think. Where do I find this one?

The only file you must edit is: "sendmail.ini"
Insert there the same data as in your normal email client (eg. Outlook)

And, if you want use sendmail with PHP, you must edit the file "php.ini". Remove the semicolon in line ~672:
Code: Select all
sendmail_path = "..."
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Hunter » 18. September 2005 10:41

Sounded easy but guess I´m doing something wrong. My sendmail.ini looks like this now:

path:"C:\xampp\sendmail"
Code: Select all
[sendmail]
smtp_server=http://www.passagen.com
default_domain=83.227.193.230/wings2/phpBB2/
error_logfile=error.log
auth_username=hunter_wow
auth_password=xxx
pop3_server=
pop3_username=
pop3_password=
force_sender=test-mail
hostname=test


then I changed my php.ini and line 672 looks like this:
path:"C:\xampp\apache\bin\php.ini"
Code: Select all
sendmail_path = "\xampp\sendmail\sendmail.exe -t"


and finaly my form at the send page looks like this:
path: "C:\xampp\htdocs\wings2\phpBB2\templates\phpBB_Portal"
Code: Select all
<?php

        // Handle POST method.
        if ($_POST)
        {
            $name = $_POST['name'];
            $email = $_POST['email'];
            $comments = $_POST['comments'];

            // Compose simple text message:
            $message = "Message from $name ($email)\n\nComments:\n\n$comments";

            // Send message to hunter_wows@passagen.com
            mail("hunter_wows@passagen.com", "Feedback", $message);

            // Thank the generous user
            echo "<h1>Cheers!</h1>\n";
        }
        else
        {

?>

<form action="<?= $PHP_SELF ?>" method="post">
<br>

<table border="0" cellpadding="0" cellspacing="0" class="InputText2">
<tr>
   <td>Namn:</td>
   <td><input type="text" name="name" size="25" size="20" maxlength="25" class="InputText"></td>
</tr>
<tr>
   <td>E-post:</td>
   <td><input type="text" name="email" size="25" size="20" maxlength="25" class="InputText"></td>
</tr>
<tr>
   <td colspan="2" height="10"></td>
</tr>
<tr>
   <td valign="top">Meddelande:</td>
   <td><textarea class="InputTexta" name="comments" rows="6" cols="28"></textarea></td>
</tr>
<tr>
   <td colspan="2" height="10"></td>
</tr>
<tr>
   <td></td>
   <td><input type="submit" value="Skicka" class="InputText2"> <input type="reset" value="Rensa" class="InputText2"></td>
</tr>
</table>
</form>


but I´m getting "No right Error 403" when sending. What am I doing wrong?
Hunter
 
Posts: 32
Joined: 03. September 2005 16:29

Postby Wiedmann » 18. September 2005 11:14

smtp_server=http://www.passagen.com

Here you must setup a SMTP-Server (as you did it in Outlook), not a Webserver! IMHO something like:
Code: Select all
smtp_server=epost.passagen.se

If you have questions about your SMTP Server, please ask your provider (I can not realy read swedish...)

Don't enable the next items (because you don't need them):
Code: Select all
;default_domain=
;pop3_server=
;pop3_username=
;pop3_password=


Set this to your Email address to avoid problems:
Code: Select all
force_sender=hunter_wow@passagen.se


What is this?
hostname=test

"hostname" is not part of my "sendmail.ini"...

sendmail_path = "\xampp\sendmail\sendmail.exe -t"

I think that's ok. BTW: You have not used the "setup_xampp.bat"?

but I´m getting "No right Error 403" when sending.

You get this error in your browser? If yes, look in the Apache "error.log".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Hunter » 18. September 2005 15:47

What is this?
hostname=test

"hostname" is not part of my "sendmail.ini"...

description:
Code: Select all
; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting.  you can manually set the ehlo/helo name if required

I remove it then if it´s not importante.

You have not used the "setup_xampp.bat

Dont understand. But the path was in there(I havent made it)
(sendmail_path = "\xampp\sendmail\sendmail.exe -t") and it´s looking good.

Right now I´m working on understanding the program "free SMTP server". Once I understand that one you will hear from me again for results
Hunter
 
Posts: 32
Joined: 03. September 2005 16:29

Postby Wiedmann » 18. September 2005 17:27

description:
Code: Select all
; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting.  you can manually set the ehlo/helo name if required

I remove it then if it´s not importante.

What is your XAMPP version? This line is definitely not in my "sendmail.ini".

[quote="Wiedmann]You have not used the "setup_xampp.bat

Dont understand.[/quote]
You have read the install instruction?
--> readme_en.txt --> Step one
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Hunter » 18. September 2005 19:29

What is your XAMPP version?

ApacheFriends XAMPP (basic package) version 1.4.15

You have read the install instruction?

Not quite. But apache and mysql working fine. Is nothing about sending mail there right?
Hunter
 
Posts: 32
Joined: 03. September 2005 16:29

Postby Hunter » 19. September 2005 21:24

Dam, took me a LONG time to find an SMTP server. But I think I got one now.
I dont know if I have made the right settings but it looks like this:
http://83.227.193.230/pic/smtp/

It is installed here: "C:\Program\SMTP Server Pro"

If the settings is fine I guess my next step will be to add:
Code: Select all
smtp_server=

Into my "sendmail". Any idea which path I should add?

And after that: Am I ready to go then?

edit: I´m sorry of I´m so dummy. But I have no idea what I´m doing. Just whant the forum at my page to work. I REALLY appreciate your help a lot!
Hunter
 
Posts: 32
Joined: 03. September 2005 16:29

Postby taustin » 19. September 2005 21:59

Localhost should do it.
taustin
 
Posts: 150
Joined: 24. September 2004 00:23
Location: Huntington Beach CA

Postby Hunter » 19. September 2005 22:15

thanks! I have now added "sendmail"(path: htdocs/sendmail) in:
http://83.227.193.230/pic/smtp/

1. Looks right?

2. How do I mail messages from my page now? Add an "action" right?
<form method="post">
<textarea name="comments" rows="6" cols="60">
</textarea>

<input type="submit" value="Send">
</form>
Hunter
 
Posts: 32
Joined: 03. September 2005 16:29

Postby taustin » 19. September 2005 23:20

Ah, no. I think there's some confusion here.

Normally, a mail server like SMTP Server Pro will accept a message from your client (your web page, in this case), and deliver it directly. This is an ability that spammers have abused a lot in recent years, however, so many ISPs do not allow it. Instead, they force you to send all mail through their server, so they can check it for spam and viruses, and track it back to the sender if there's a problem. When you set up your own mail server, it has to be set to use a "Smart Host," or relay, so that instead of sending email directly to the recipient, it will send to your ISP's mail server. That is what the SMTP gateway settings are for. They are currently set to have SMTP Server Pro to send to itself, which will cause all manner or problems.

What needs to be set to "localhost" is the PHP settings. I'm not sure what the "sendmail" file (the last screen shot that I see) is, but it seems to be pointed at "localhost." However, I am confused as to exactly what you're doing.

This forum is for Xampp running on Windows, and Sendmail for Windows is not free, nor, as far as I know, included in Xampp (though I'm a couple of versions behind). And if you're using Sendmail, then you shouldn't need SMTP Server Pro at all.

So, are you running this on a Windows computer? If so, are you writing your web page in PHP? If you are, are you using a PHP script that someone else wrote, or writing your own?
taustin
 
Posts: 150
Joined: 24. September 2004 00:23
Location: Huntington Beach CA

Postby Hunter » 20. September 2005 07:38

Normally, a mail server like SMTP Server Pro will accept a message from your client (your web page, in this case), and deliver it directly.

Jepp, this is what I whant to do

What needs to be set to "localhost" is the PHP settings

Like this?:
file: php.ini path:"C:\xampp\apache\bin"
Code: Select all
sendmail_path = "localhost"


but it seems to be pointed at "localhost." However, I am confused as to exactly what you're doing.

Hmm, any exampel or idea what it should be pointing at becouse I have no clue what I´m doing...


Sendmail for Windows is not free

:O Can someone confirm this?...

And if you're using Sendmail, then you shouldn't need SMTP Server Pro at all

Both instructions and Wiedmann telling me I need an SMTP server for this to work if I havent missunderstand something.

So, are you running this on a Windows computer?

Yes, Windows XP Home. Getting mutch complaining about that but it´s working great this far.

If so, are you writing your web page in PHP? If you are, are you using a PHP script that someone else wrote, or writing your own?

Using phpBB and using freescripts yes. Looking like this:
File path: "C:\xampp\htdocs\wings2\phpBB2"
Code: Select all
<html>
    <head>
        <title>Mailformulär</title>
    </head>
    <body>
    <?php
        if (!$Submit){
    ?>
        <form name="form1" method="post" action=" <?php echo $PHP_SELF?> ">
            <input type="text" name="name" value="Write Name">
            <input type="text" name="surname" value="Write Surname">
            <input type="text" name="titel" value="Titel at mail">

            <input type="submit" name="Submit" value="Send">
            <input type="reset" name="Submit2" value="Reset">
        </form>
    <?php
        } else {
            $mailadress = "hunter_wow@passagen.se";
            mail("$mailadress", "$titel",
            "Was sent by:\n$name $surname");
            echo "Mail has been sent to $mailadress";
        }
    ?>
    </body>
</html>
Hunter
 
Posts: 32
Joined: 03. September 2005 16:29

Postby taustin » 20. September 2005 16:55

Ok, there's a lot of confusion here.

PHP was originally written for Unix/Linus, rather than Windows. In the *nix world, when you want to send email, you usually use Sendmail, which is the sending part of an email server. It's free, it's included in nearly every distribution of Linux and Unix, and it works. But so far as I know, the Windows version isn't free, and wasn't available at all when PHP was first ported to Windows.

So support for sending by normal SMTP functions was included in the Windows version of PHP. It's a different way of doing the same thing. You have to use one or the other, and can't mix them. Apparently, at the moment, you're mixing them.

What you need to do is open the php.ini file you indicated, and search for the section that starts with

[mail function]

Under that section, you need the following two lines:

SMTP = localhost
sendmail_from = your@email.address

The first one says to use the SMTP functions instead of the Sendmail functions. The second one should be set to whatever email address you want email to be sent from.

Under that, find this line

sendmail_path = whatever

and put a semicolon in front of it, like this:

;sendmail_path =

This turns off the Sendmail functions completely.

At this point, you must restart Apache for the changes to take effect.

This will set up Apache and PHP to use the mail server you have installed.

PHPBB, however, so far as I know, does not use the built-in email functions in PHP, because they are fairly limited. I believe it includes its own, scratch-built email engine.

Make sure the above changes are done, then go to the Administator Panel in PHPBB. Under General Admin, go to the Configuration link. At the bottom, there are Email Settings. Set the proper address for the administrator, and make sure the "Use SMTP Server for email" is set to "yes." The SMTP Server Address should be "localhost" (without the quotes). Leave the username and password blank unless you've set an SMTP AUTH password for the mail server. (If you're not sure what that means, you probably haven't set one. If you have, you should get an error message when you try to send, that mentions SMTP AUTH or something similar.)

That should do it.
taustin
 
Posts: 150
Joined: 24. September 2004 00:23
Location: Huntington Beach CA

Postby Wiedmann » 20. September 2005 17:19

PHP was originally written for Unix/Linus, rather than Windows. In the *nix world, when you want to send email, you usually use Sendmail, which is the sending part of an email server. It's free, it's included in nearly every distribution of Linux and Unix, and it works. But so far as I know, the Windows version isn't free, and wasn't available at all when PHP was first ported to Windows.

So support for sending by normal SMTP functions was included in the Windows version of PHP. It's a different way of doing the same thing. You have to use one or the other, and can't mix them. Apparently, at the moment, you're mixing them.

Hallo Taustin,

You are right, the mail function on Windows uses normaly SMTP. But it can not use SMTP AUTH. And most provider requires that to use their SMTP - server.

At this point I decide to add a free sendmail to the XAMPP package. You know, PHP/Win can also use a senmail binary. This sendmail can use your normal postbox to send the mail.

And this is the problem i think. The sendmail needs access to the SMTP - server from the provider. And some people have only a webmail account or HTTP mail (Hotmail) and not a real mailaccount with SMTP/POP. And with Webmail or HTTP mail this sendmail can not work together.

You can test this with a newer XAMPP package.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby taustin » 20. September 2005 17:56

Wiedmann wrote:
PHP was originally written for Unix/Linus, rather than Windows. In the *nix world, when you want to send email, you usually use Sendmail, which is the sending part of an email server. It's free, it's included in nearly every distribution of Linux and Unix, and it works. But so far as I know, the Windows version isn't free, and wasn't available at all when PHP was first ported to Windows.

So support for sending by normal SMTP functions was included in the Windows version of PHP. It's a different way of doing the same thing. You have to use one or the other, and can't mix them. Apparently, at the moment, you're mixing them.

Hallo Taustin,

You are right, the mail function on Windows uses normaly SMTP. But it can not use SMTP AUTH. And most provider requires that to use their SMTP - server.

At this point I decide to add a free sendmail to the XAMPP package. You know, PHP/Win can also use a senmail binary. This sendmail can use your normal postbox to send the mail.

And this is the problem i think. The sendmail needs access to the SMTP - server from the provider. And some people have only a webmail account or HTTP mail (Hotmail) and not a real mailaccount with SMTP/POP. And with Webmail or HTTP mail this sendmail can not work together.

You can test this with a newer XAMPP package.


I see. That makes it rather difficult for some. In this case, however, PHPBB uses its own SMTP engine, which does support SMTP AUTH. And Hunter seems to think he can send direct anyway, which elimiates the whole problem as he can control the server settings.
taustin
 
Posts: 150
Joined: 24. September 2004 00:23
Location: Huntington Beach CA

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 75 guests