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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Outlook and CFMAIL

Status
Not open for further replies.

newbieDev

Programmer
Jun 11, 2007
38
US
Hi Everyone,

I have a question someone here might be able to help with.

I want to send date notifications to a list of people using cfmail. However, I want the email to be in the form of a meeting request so that it can automatically be placed on their calenders. Is there a way to send the email with coldfusion and have outlook accept it as a meeting request?

Thank you.
 
You can start with


I know it may not give the exact behavior you're after, but users can click on the attachment and the appointment will be added to their calendar.

The alternatives include invoking an Outlook application object, which is not recommended in an unattended server environment.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Pity the insomniac dyslexic agnostic. He stays up all night, wondering if there really is a dog.
 
Thanks for the reply!


I still dont understand how.
Lets say this is my schedule, How do I send this as an attatchment with the email?

<cfif DayofWeekAsString(DayOfWeek(Now())) NEQ 'Saturday' OR 'Sunday' >
<cfschedule action = "run" interval="daily"
task = "send"

enddate="8/22/07"
endtime="2:00 pm"


operation = "HTTPRequest"
url =" startDate = "8/22/07"
startTime = "1:50 PM"
resolveURL = "Yes"
requestTimeOut = "600">
</cfif>

Could you please give an example?

Thanks again.
 
1. Create a file on your server, using the <cffile action = "write" file = "full_path_name" output = "content"> tag,
with the <Some Event Name>.calendar as the file name.

2. Write its contents to match the example in the link above and then <cfmail> it to your recipient(s) as an attachment.

When they open it outlook will, if they have it installed, open it as a calendar record.





Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 

Let me see if I get this:

Create a file with the below code in it
(file name = event1.calender)

<cffile action = "write"
file = "full_path_name"
output =
"
name = Test
submit_by = test...@test.com
Event = Some Event
Location = Some Place
StartMonth = 01
StartDay = 01
StartYear = 2005
StartHour = 03
StartMinute = :25
StartTime =
EndMonth = 01
EndDay = 02
EndYear = 2005
EndHour = 04
EndMinute = :45
EndTime =
discription = Some Discription of an event.
"
>

Then cfmail this along with the email message/text to recepients?


what is this for? -- file = "full_path_name"

Thanks!

 
That's the file and path that the CFFILE will create. It will be the attachment for your email.
 
I see in your first reply that you are planning to launch this with a <cfschedule> tag.

What is the source of your data?

If it's in a database I would try something like this:
Code:
<cfquery name="getMsgData" datasource"#mySrc#">
   ...Your query here
</cfquery>
<cfquery name="getReciepents" datasource="#mySrc#">
	Select emial
	From tblReciepent
</cfquery>
<cfoutput query="getMsgData">
	<cfsavecontent variable = "report">
		Event = #getMsgData.Event#<br>
		Location = #getMsgData.Location#<br>
		StartMonth = #getMsgData.StartMonth#<br>
		... The rest of your values<br>
	</cfsavecontent>
	<cffile action = "write" file = "someFileName.txt" output = #report#>
	<cfmail to="#ValueList(getReciepents.email)#" 
			from="you@yourdomain.com" 
			<cfmailparam file = "someFileName.txt">
			... the rest of your parameters
	>
</cfoutput>

Not tested but should be close enough that you can start writing and post YOUR code if more help is needed.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Thanks Lyndon!

I will test this and let you know how it works out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top