Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send appointment with CDOSYS

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
Is it possible to generate an email in ASP that isn't just HTML? Basically I need to send a calendar entry to someone. At the moment I have been sending blank emails with a .ICS file attached but this doesn't allow someone to accept on someone else's behalf.

cheers

Ed
 
I found the following script on msdn but have been unable to get it to work. The error I get is:

Microsoft VBScript runtime error '800a01a8'

Object required: 'iMbx'

Any ideas?

Thanks

<%

Dim iAppt
Dim Config
Dim iCalMsg
Dim iAttn1
Dim iMsg


' Set the configuration fields.
Config.Fields("CalendarLocation") = iMbx.Calendar
Config.Fields(cdoSendEmailAddress) = "e.mozley@mydomain.co.uk"
Config.Fields.Update


With iAppt
Set .Configuration = Config

' Set the appointment properties.
.StartTime = #8/20/1999 10:00:00 AM#
.EndTime = #8/20/1999 11:30:00 AM#
.Subject = "Department meeting"
.Location = "Executive Conference Room"

' Add a required attendee.
Set iAttn = .Attendees.Add
iAttn.Address = "MAILTO:e.mozley@mydomain.co.uk"
iAttn.Role = cdoRequiredParticipant

' Add an optional attendee.
Set iAttn = .Attendees.Add
iAttn.Address = "MAILTO:another@example.com"
iAttn.Role = cdoOptionalParticipant

' Create the calendar message and send it.
Set iCalMsg = .CreateRequest
Set iMsg = iCalMsg.Message
iMsg.Send

' Save the meeting to the calendar of the organizer.
.Datasource.SaveToContainer iMbx.Calendar

End With


Set CreateAndSendMeeting = iAppt

%>
 
On MSDN it mentions CDOEX.DLL - I've had a look for this on the server and it's in the c:\program files\common files\microsoft shared\cdo folder. Do I need to put something in the code to say this is the DLL I want to use?
 
I've managed to get the following script working which uses CDOEX.DLL. If the script above uses this as well there should be some way of integrating the two. No idea where to begin though!

<%@ Language=VBScript %>
<%
submit = Request.Form.Item("B1")

if submit = "Send" then
Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")
Dim Flds
Set Flds = iConf.Fields
' 3 means that you are asking mail to be sent using Exchange Server.
%>

<%
Set iMsg.Configuration = iConf
iMsg.To = Request.Form.Item("Text1")
iMsg.From = "e.mozley@mydomain.com"
iMsg.Subject = Request.Form.Item("Text3")
iMsg.TextBody = Request.Form.Item("TextArea1")
iMsg.Send

end if

%>

<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</head>

<body bgcolor=black >
<% if submit = "Send" then
%><font color=white><b><u> Mail Sent</u></b></font> <%

else%>
<form name="mnFrm" method="post" action="SendMail.asp">
<P>
<base target="_top">
<TABLE cellPadding=4 cellSpacing=0 class=Nav2>
<tr>
<TD><font color=red>To</font> </TD>
<TD><INPUT name=Text1 size=58 style="HEIGHT: 22px; WIDTH: 500px"></TD></TR>
<TR>

<TD><LABEL><font color=red>Subject </font> </LABEL></TD>
<TD><INPUT border=0 name=Text3 size=58
style="HEIGHT: 22px; WIDTH: 500px"></TD></TR>
<TR>
<TD vAlign=top><LABEL><font color=red>Body</font> </LABEL></TD>
<TD><TEXTAREA cols=63 name=TextArea1 rows=30 style="BACKGROUND-COLOR: white; HEIGHT: 165px; WIDTH: 590px"></TEXTAREA>

<P></P>
<P><BR></P></TD></TR></TABLE><INPUT name=B1 type=submit value="Send"></P>
</form><%end if %>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top