Solved

Sending E-Mail Automatically from a web page

Posted on 2001-08-07
23
152 Views
Last Modified: 2010-04-09
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?
0
Comment
Question by:superdesio
  • 7
  • 6
  • 4
  • +4
23 Comments
 

Author Comment

by:superdesio
ID: 6361734
an example if i wanted to send a thank you to someone who just registered at my site?

0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6361760
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
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6361811
0
 
LVL 10

Expert Comment

by:dij8
ID: 6361868
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.
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6362589
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
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6362746
Didn't I more or less say that already????

Ant
0
 

Expert Comment

by:webmanager
ID: 6364155
You can use a cgi mailer form too.....
0
 
LVL 10

Expert Comment

by:dij8
ID: 6364320
Didn't I more or less say that already????

dij8
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6364344
LOL

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

:oP

Ant

P.S. Glad my earlier comment came in useful! ;o)
0
 

Author Comment

by:superdesio
ID: 6364655
the server is IIS so how would i use ASPmail?
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6364836
Take a look at:

http://www.cgiware.com/aspmailer.html

:o)

Ant
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:superdesio
ID: 6365063
if i am not mailing stuff from a form can i still use ASPmailer?  I just want to send a pre-written email.

0
 

Author Comment

by:superdesio
ID: 6365252
i need to use the mailto command.  Is there a limit on the length of the URL?

0
 

Author Comment

by:superdesio
ID: 6365386
my messages keep getting cut at 260 character urls.
0
 
LVL 10

Expert Comment

by:dij8
ID: 6365446
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
0
 
LVL 10

Expert Comment

by:dij8
ID: 6365459
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.
0
 
LVL 10

Expert Comment

by:dij8
ID: 6365471
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.
0
 

Author Comment

by:superdesio
ID: 6365532
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?
0
 
LVL 10

Expert Comment

by:dij8
ID: 6365634
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).  
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6366776
>>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
0
 
LVL 3

Expert Comment

by:CyberSoft
ID: 6372118
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
0
 

Author Comment

by:superdesio
ID: 6386163
thats what i ment.  I need it to open a message composition window. But it keeps cutting my message short to 260 chars.

0
 
LVL 3

Accepted Solution

by:
CyberSoft earned 100 total points
ID: 6387303
That's because there is a 260 (or a bit less I think 255) character limitation to the querystring.

Regards,
CyberSoft
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now