Solved

MAPI

Posted on 2002-05-29
4
531 Views
Last Modified: 2008-02-01
I AM USING FOLLOWING CODE TO SEND EMAIL USING MAPI . BUT IS THERE ANY JAVASCRIPT SOLUTION FOR SAME TYPE OF CODE.
ANY HELP WOULD BE APPRECIATED.
THANKS IN ADVANCE
SHRIRANG
<HTML>
<BODY LANGUAGE=VBS>
 ...
<SCRIPT LANGUAGE=VBS>
Sub Send_Feedback
    Dim objFBMess ' feedback message from Web page
    Dim objRecips ' can't do "Dim As" (early binding) in VBScript
' ... validate objWebSession object instantiated by HTML, then ...
objWebSession.Logon( "","",true) 'let user choose profile if not logged on
    Set objFBMess = objWebSession.Outbox.Messages.Add
    objFBMess.Subject = "Feedback from Web page"
    objFBMess.Text = Feedback.Value
    Set objRecips = objFBMess.Recipients
    objRecips.Add "custsupp" ' send to Customer Support
    objRecips.Resolve
    objFBMess.Send ' defaults to save copy and no user dialog
    objWebSession.Logoff
End Sub
</SCRIPT>
 ...
<H1><CENTER>CUSTOMER FEEDBACK WEB PAGE</H1>
<B><P>Welcome to the Customer Support Feedback Web page.
<P>If you have any additional suggestions or requests,
<P>please send
<A HREF=MAILTO:shrihalbe@hotmail.com>shrirang</A>
some e-mail.
<P>Please enter your feedback here:
<INPUT NAME=Feedback TYPE=Text SIZE=80>
<INPUT ONCLICK=Send_Feedback TYPE=Button VALUE="Send Feedback">
<OBJECT CLASSID="clsid:3FA7DEB3-6438-101B-ACC1-00AA00423326" ID=objWebSession>
<! The OBJECT tag instantiates the CDO Session object>
</OBJECT>
</BODY>
</HTML>
 
0
Comment
Question by:shrihalbe
  • 2
4 Comments
 
LVL 7

Expert Comment

by:cstsang
ID: 7043557
As I know, there are no way to so.
0
 
LVL 33

Accepted Solution

by:
hongjun earned 50 total points
ID: 7043622
Alternative is to use server side scripting like ASP. You then can choose either using CDONTS or a component like AspEmail to send email.


 Below will tell you how to send email using coding.
Please note that normal HTML will not be able to achieve sending an email with attachments. In HTML we use mailto and that only restricts us in the To, Cc, Bcc, Subject and Body field. To send an email with attachments, you need to use a server-side scripting language. I will show you how to do that in Active Server Pages (ASP). That means you will need a web server.

If you are using Win NT or Win 2000 and have CDONTS.dll installed, then you can do the following using Internt Information Server (IIS) as your web server.
<%
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
%>

If you wish to include an attachment, below is the syntax
objNewMail.AttachFile(Source [, FileName] [, EncodingMethod] )

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

If you do not have IIS because you are not running ntfs partition, then you will need to download a web server and I recommend you using Personal Web Server (PWS). Download it at http://www.microsoft.com/ntserver/nts/downloads/recommended/nt4optpk/default.asp. Note that PWS will not be able to support CDONTS.

If you are using other versions of Windows, then you got to install a server component. I recommend using AspEmail. It can be downloaded from http://www.aspemail.com
To learn how to code using the AspEmail component, you can download its user manual from the site itself. It is very comprehensive and complete. There's even an asp example page showing that.

Good Luck
hongjun
0
 

Author Comment

by:shrihalbe
ID: 7054570
Thanks hongjun ,
shri
0
 
LVL 33

Expert Comment

by:hongjun
ID: 7061598
welcome. glad to help.

hongjun
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

708 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

11 Experts available now in Live!

Get 1:1 Help Now