Here are a couple of examples using CF to create an instance of Server
Object's ASPMail.
I've been working on this piece of code lately using <cfscript> and CF 4.5's
new function, CreateObject.
<cfscript>
Mailer = CreateObject ("COM", "SMTPsvg.Mailer");
Mailer.FromName = "Leong Yew";
Mailer.FromAddress = "[EMAIL PROTECTED]";
Mailer.RemoteHost = "mail.netinfiniti.com";
Mailer.Subject = "CF-ASPMail Test";
Mailer.BodyText = "Dear so and so," & chr(10) & "This really works!!";
Mailer.AddRecipient ("Myself", "[EMAIL PROTECTED]");
Mailer.AddExtraHeader ("X-mailer: Mailserver 1.0 Beta");
Mailer.AddExtraHeader ("X-AdminNotice: If you suspect that this message has
violated netiquette please forward it to [EMAIL PROTECTED]");
Result = Mailer.Sendmail();
WriteOutput ("Email Sending Results = " & Result);
</cfscript>
Or you could use the <CFOBJECT> tag:
<cfobject action="create" name="Mailer" class="SMTPsvg.Mailer">
<cfset Mailer.FromName = "Leong Yew">
<cfset Mailer.FromAddress = "[EMAIL PROTECTED]">
<cfset Mailer.RemoteHost = "mail.netinfiniti.com">
<cfset Mailer.Subject = "CF-ASPMail Test">
<cfset Mailer.BodyText = "Dear so and so," & chr(10) & "This really
works!!">
<cfset Mailer.AddRecipient ("Myself", "[EMAIL PROTECTED]")>
<cfset Mailer.AddExtraHeader ("X-mailer: Mailserver 1.0 Beta")>
<cfset Mailer.AddExtraHeader ("X-AdminNotice: If you suspect that this
message has violated netiquette please forward it to
[EMAIL PROTECTED]")>
<cfset Result = Mailer.Sendmail()>
<cfoutput>Email Sending Results = #Result#</cfoutput>
Hope this helps.
Leong Yew
-----Original Message-----
From: Ben Lowndes [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 14, 2000 12:32 AM
To: [EMAIL PROTECTED]
Subject: CF and COM example
Hi,
I'm interested in using CF with COM. I've got advanced CF application
development by ben forta which has an interesting chapter. I've tried
following his examples, unfortunatly the COM object he uses as an example is
no longer availible and it's not on the accompanying CD......
So I'm a bit stuck and am looking for a really basic example of COM with CF,
just something so I can test and see it working on a remote (non web) NT
Server.
Anyone able to help?
Thanks
Ben.
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.