Link to home
Start Free TrialLog in
Avatar of superdesio
superdesio

asked on

Sending E-Mail Automatically from a web page

Is there a way to automatically fire off a email?  Im tryin to use the mailto: command but the brings up the message compose window which i dont want but if i have to keep that why does it cut off some of the body of my message. Is there a limit on length of the URL?
Avatar of superdesio
superdesio

ASKER

an example if i wanted to send a thank you to someone who just registered at my site?

If someone has just registered at your site then you must have a server-side script to do that, yes?

If so, then it is much better to fire an email from the server, perhaps using the same script.

Avoid mailto whenever possible, it is fraught with problems and often won't work.

Ant
As has been said, if you want to send email without any prompting then it MUST be done srver side.  This is exactly what I have done on my site.

How you do this is determined by what your server supports.  If it supports CGI then I am sure someone here can give you CGI code that will do that for you.  Or there may already be a CGI script on the server that does it.  If it supports ASP then I could probably give you code for that.  Better still, if the server is IIS then there may be ASPMail installed.  Which is really easy and I can definitely give you code for that.  Then there is JSP, PHP, ColdFusion, and other languages as well.

Before any of this can be given to you we need to know what options you have.
The use of mailto will not solve your problem. It requires user intervention. You need a server side scripting like ASP.

Firstly, you got to tell us are do you know of any server side language? If yes, what are they and which one do you intend to use.

hongjun
Didn't I more or less say that already????

Ant
You can use a cgi mailer form too.....
Didn't I more or less say that already????

dij8
LOL

It's amazing isn't it dij8......

:oP

Ant

P.S. Glad my earlier comment came in useful! ;o)
the server is IIS so how would i use ASPmail?
if i am not mailing stuff from a form can i still use ASPmailer?  I just want to send a pre-written email.

i need to use the mailto command.  Is there a limit on the length of the URL?

my messages keep getting cut at 260 character urls.
I would guess then that there is a 260 character limit on URL's.  I know there used to be a security issue with long URL's.  Maybe this is a part of the fix.

ASPMail is probably the most common email component used in ASP.  Even more common than CDONTS which is built into IIS.  It is a third party component though and needs to be installed.  If it is then I can give you the code you need.

Details on ASPMail can be found at http://www.serverobjects.com/products.htm#aspmail

Details on CDONTS (built into IIS and I can give you code for that as well) can be found at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/_denali_newmail_object_cdonts_library_.asp
Oh yeah, and you can send what you want in the email (either with ASPMail or CDONTS).  It does not need to be processed by a form.  It does need an email address so if you want to send anything to the user then you will need to get their email address somehow.
Oh yeah, and you can send what you want in the email (either with ASPMail or CDONTS).  It does not need to be processed by a form.  It does need an email address so if you want to send anything to the user then you will need to get their email address somehow.
i dont want to use my server to send the email.  I need whatever the persons computer is configured to send the email.  Is there some kind of URL limit on the server?
If your URL is getting cut at 260 characters then yes there is.

Netscape say there isn't with their browser, http://help.netscape.com/kb/consumer/19971015-8.html

Someone else has this to say, http://www.intranetjournal.com/ix/msg/17613.html
and this, http://www.intranetjournal.com/ix/msg/12950.html

I found this from Microsoft, http://support.microsoft.com/support/kb/articles/Q260/6/94.ASP

I do not believe there is a limit in the HTTP 1.0 spec (RFC
1945) or the URL spec (RFC 1738).  
>>if i am not mailing stuff from a form can i still use ASPmailer

Yes you can.

Below is a code that uses CDONTS.NewMail to send an email. It is a built-in component when you are using IIS. You got to setup SMTP services and make sure that it is running.

<%
Dim objMailer
Dim strBody

' You can have HTML tags here
' You can therefore customize the format you want to send
strBody = "<TABLE BORDER='0'><TR><TD>Hello</TD><TD>World</TD></TR></TABLE>"

Set objMailer = CreateObject("CDONTS.Newmail")
objMailer.From = "sender@domain.com"
objMailer.To = "receipent@domain.com"
objMailer.Subject = "Your subject here"
objMailer.BodyFormat = 0
objMailer.Mailformat = 0
objMailer.Body = strBody
objMailer.Send
Set objMailer = Nothing
%>

See this for more information on CDONTS.
http://msdn.microsoft.com/library/psdk/cdo/_denali_newmail_object_cdonts_library_.htm

Notice from the coding that you can indicate the body of the mail to be sent without using a form.

hongjun
You wrote:

i dont want to use my server to send the email.  I need whatever the persons computer is configured
to send the email.  Is there some kind of URL limit on the server?

Hi superdesio,

No, as far as I am aware there is no way you can automatically get he user's machine to automatically (ie without them knowing it and without their intervention) send off an email using their mail client - that would just be a security risk at best.

Regards,
CyberSoft
thats what i ment.  I need it to open a message composition window. But it keeps cutting my message short to 260 chars.

ASKER CERTIFIED SOLUTION
Avatar of CyberSoft
CyberSoft
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial