Anyone got an email php script for me?

EdFred

Taxi to Parking
Joined
Feb 25, 2005
Messages
30,197
Location
Michigan
Display Name

Display name:
White Chocolate
I've been looking for them online, but non of em seem to work.
Don't need anything fancy, just need to get my e-mail address off the website to quit getting spam bombed.


Oh, I should also say that I'm running Server 2003, and Exchange as the emailer.

(Shush - it works for what we do.)
 
Last edited:
I have used quite a few php e-mail solutions.

All of the decent ones are going to require you have an IMAP server setup.

Squirrelmail is pretty easy to setup. http://www.squirrelmail.org/

Right now I have Horde/IMP setup on my server. The setup is not for the weak of heart, it's quite a hassle. (both of these were done on linux servers)
http://www.horde.org/
 
Ok, I think I found the problem, but of course don't know how to fix it.
The scripts are not accessing the sendmail.dll, or at least appear to not e doing so.

How do I get PHP to look in C:\Window\System32\ to find the sendmail.dll file?

I didn't see anything in the php.ini file that allows for that. Or should it do it automatically? Or is it accessing it, but IIS isn't set up to run the send mail. I checked the help file on IIS, and of course it was more than useless. "sendmail" not found in help database. Great.
 
N2212R said:
Ok, I think I found the problem, but of course don't know how to fix it.
The scripts are not accessing the sendmail.dll, or at least appear to not e doing so.

How do I get PHP to look in C:\Window\System32\ to find the sendmail.dll file?

I didn't see anything in the php.ini file that allows for that. Or should it do it automatically? Or is it accessing it, but IIS isn't set up to run the send mail. I checked the help file on IIS, and of course it was more than useless. "sendmail" not found in help database. Great.

I'm generally a Linux/Unix administrator. I pretty much avoid windows as much as I can as far as servers go. But I'll do the best that I can get help you.

In php.ini you are going to want to specify:

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com

I beleive it's going to just want to talk directly to an SMTP server (whereas in *nix it generally just accesses the sendmail binary) ... Now *if* I remember correctly in IIS (internet information services) there is an option to setup a simple SMTP server. (once again I haven't delt with this stuff in a very long time with windows).. So if you set that up, and then specify in your php.ini SMTP = localhost it should work. You are going to want to also specify the from address.

Now.. *Most* php web mail scripts that I have seen in their OWN configuration files simply want you to specify a SMTP server.
 
the smtp was setup to localhost.

I will try and change that sendmail from line and see if that works.

Thnks
 
N2212R said:
the smtp was setup to localhost.

I will try and change that sendmail from line and see if that works.

Thnks

Yeah that wont fix it. Thats just the from address.

There is a good chance the php script you are trying to use is looking for sendmail itself.. Probably in /usr/bin/sendmail...ovbviously not going to work on a windows system.

Which script are you using?
 
Used about 10 different scripts none of them working.

sendmail.dll is in C:\Windows\System32\

That's the ONLY place anything called sendmail shows up

the website is hosted in D:\website\ (the ONLY folder in that drive)
and all the PHP stuff is in C:\PHP5\

I finally got frustrated and got rid of everything php related from my server when oddly enough I couldn't access any websites with php running when I made one further change. (POA, AOPA, PiperChat)

I tried setting paths, I changed localhost to the servers IP address, I included the C:\Windows\System32\ path in the php.ini file.

nothing worked at all.
 
Hey Jesse,
Since you're a Linux sendmail expert, maybe I could ask you a question too?

I'm trying to masquerade my local machine "garlic" as the UAA campus webserver, so that all replies to email get sent to the UAA campus webserver instead of "garlic". But some of my users are not from UAA, and I want to exclude them from masquerading... I put them in my sendmail.mc file as:
EXPOSED_USER('root') <---which was already there
EXPOSED_USER('kandeen')

Problem is, when I add another EXPOSED_USER line to the file for a second user, something barfs, incoming mail isn't handled properly, and I get tons of error messages because the error messages to "root" have nowhere to go.

Any clues?

Also, since only a few of my users are here, is there a way to masquerade only one or two users? Rather than masquerade everybody and exempt only one or two users?

(Sorry if this is off-topic!)

--Kath
 
kath said:
Hey Jesse,
Since you're a Linux sendmail expert, maybe I could ask you a question too?

I'm trying to masquerade my local machine "garlic" as the UAA campus webserver, so that all replies to email get sent to the UAA campus webserver instead of "garlic". But some of my users are not from UAA, and I want to exclude them from masquerading... I put them in my sendmail.mc file as:
EXPOSED_USER('root') <---which was already there
EXPOSED_USER('kandeen')

Problem is, when I add another EXPOSED_USER line to the file for a second user, something barfs, incoming mail isn't handled properly, and I get tons of error messages because the error messages to "root" have nowhere to go.

Any clues?

Also, since only a few of my users are here, is there a way to masquerade only one or two users? Rather than masquerade everybody and exempt only one or two users?

(Sorry if this is off-topic!)

--Kath

Have you ever considered..not using sendmail?

I quit using it about three years ago, I was just plain sick and tired of the continous security issues. It's basically a fulltime job to maintain an internet facing sendmail server. security is a major issue. you about have t ohave it in a chroot to even START to be secure.

I switched to exim (which is the preferred e-mail server with debian linux) ..I'm now using exim4.

I really don't know what to tell you with sendmail, it's config is VERY sensitive as you noticed..and quite easy to break.

When I used and deployed sendmail as an smtp solution I bought a book by Orielly that was..very useful.

A proper sendmail setup takes a LOT of time.
 
This one creates a javascript behind a link on your web page that generates a mailto: URL. Your email address is encrypted in the javascript code. It doesn't need anything on the server side. You can even display your email address as the link and it won't be readable to bots. You can still copy and paste the address!

http://www.jracademy.com/~jtucek/email

It works fine for me.
 
Last edited:
mikea said:
This one creates a javascript mailto: URL from a link on your web page where the email address is encrypted. It doesn't need anything on the server side. You can even display your email address as the link and it won't be readable to bots.

http://www.jracademy.com/~jtucek/email

It works fine for me.

Mike - that rocks, and should solve my problems for now.
 
OH. That is what you are trying to accomplish. I thought you were simply trying to setup a web based e-mail system.

It's very simple to write a php script to e-mail using the mail(); function.

It's going to depend on, for windows, that SMTP section set.. along with a working SMTP server running on your server.

I would *really* avoid the javascript mailto: solution..Simply because *SO* many people use strictly web based mail now.
 
jangell said:
I would *really* avoid the javascript mailto: solution..Simply because *SO* many people use strictly web based mail now.


If you knew what my business was no one is going to be mailing me from yahoo/hotmail/gmail, etc.

I think the 8 years I've had some sort of web presence I've gotten exactly 1 non corporate e-mail sent to our company e-mail. by corporate e-mail, I mean ford.com gm.com ibm.com, etc...

I thought my first post said i was only looking for a script so I wouldn't get spam bombed by having my e-mail address on the site. Oh and it was the mail() command that was giving me fits!
 
N2212R said:
If you knew what my business was no one is going to be mailing me from yahoo/hotmail/gmail, etc.

I think the 8 years I've had some sort of web presence I've gotten exactly 1 non corporate e-mail sent to our company e-mail. by corporate e-mail, I mean ford.com gm.com ibm.com, etc...

I thought my first post said i was only looking for a script so I wouldn't get spam bombed by having my e-mail address on the site. Oh and it was the mail() command that was giving me fits!

Yeah for the mail() to work you need to be running your own SMTP server in windows.

The problem though. Is many large corporate companies are rolling to web based solutions for everything. If an employee of one of those companies attempted to use your script, The web browser will attempt to launch their default e-mail client..problem is they don't have a default e-mail client. They don't even have an e-mail client. Therefore they are annoyed, and you might not ever get your e-mail as now they don't even know your e-mail address and your form doesn't work.

Now. If your main deal is that you don't want spambots picking up your e-mail address. Simply put it in an image like:
email.jpg
 
jangell said:
I would *really* avoid the javascript mailto: solution..Simply because *SO* many people use strictly web based mail now.
With that javascript solution above, if you choose the "less secure" option to display the address, the client can still copy and paste the email address from the web page. When I'm using web mail I do that from the web page or from address bar in the email client.
 
jangell said:
I haven't delt with this stuff in a very long time

:goofy: No offense and don't take this the wrong way, but you 18, you have no idea of what a "very long time is". You need a mother in law before you can really even understand the concept....:D
 
Henning said:
:goofy: No offense and don't take this the wrong way, but you 18, you have no idea of what a "very long time is". You need a mother in law before you can really even understand the concept....:D
:D

"very long time" is relative. That is the beauty.

All I'm really saying is no offense to anyone, But using a contact form that pops open your e-mail client and fails to work if you don't have an e-mail client is really poor design. Many users would be confused, and a confused user leads rapidly to a frustrated user.

An example of how it should be done:

http://www.jesseangell.com/website/contactme.php

Source code for that:
html page said:
<form action="process.php" method="post">
<p>&nbsp;</p>
<table width="200" border="0">
<tr>
<td width="61"><p>Name:</p></td>
<td width="123"><input type="text" name="name" size="20" maxlength="20"></td>
</tr>
<tr>
<td><p>E-mail:</p></td>
<td><input type="text" name="email" size="30" maxlength="30"></td>
</tr>
<tr>
<td valign="top"><p>Message:</p></td>
<td><textarea name="text" cols="50" rows="10"></textarea></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Send"></td>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp; </p>
</form>
PHP script that proccesses it said:
<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$text = stripslashes($text);
mail('jesse@jesseangell.com','Website Form',$text,"From: $name <$email>");
header("location:thankyou.php");
?>
That's it. 6 lines of PHP code make this all happen.

Of course if you are on a windows server, I feel for you, Just setup a simple SMTP server.. Put the SMTP server in the php.ini and you are golden.
 
Last edited:
Back
Top