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!

CDOSYS - Problem with Attachments

Status
Not open for further replies.

dougcranston

Technical User
Oct 5, 2001
326
US
I have the need to send an HTML formatted email due to a table layout, plus attach a number of Word and Excel documents.

The script I have created does this, however, what is viewable in the received email is the HTML and the uploaded files starting at the RIGHT of the html content and continuing to the bottom of the HTML.

Is there some way I can force the attachments to appear at the end of the document?

Environment:
=============
Server IIS 5
Email program: CDO/CDOSYS
Client: Email client is Lotus Notes.
Web Client: Web based version is Lotus WebNotes.

Script Sample:
===============
function sndEmail(ScriptType, strFrom, strTo, strCc, strSubject, strBody) {

var strScriptType = new String(ScriptType);
strScriptType = Trim(strScriptType);
strScriptType = strScriptType.toUpperCase();
var strMailFrom = new String(strFrom);
var strMailTo = new String(strTo);
var strMailSubject = new String(strSubject);
var strMailCc = new String(strCc);
var strMailBody = new String(strBody);


// Create CDO object depending on Script_Type
// Script_Type can be ASP(run on an asp page) or JS(run through a jScript)
if (strScriptType == "ASP") {
var cdoMessage = Server.CreateObject("CDO.Message");
var cdoConfig = Server.CreateObject("CDO.Configuration");
}
if (strScriptType == "JS") {
var cdoMessage = new ActiveXObject("CDO.Message");
var cdoConfig = new ActiveXObject("CDO.Configuration");
}

// assign ref for cdo
var cdoSendUsingMethod = " var cdoSMTPServer = " var cdoSMTPServerPort = "
// assign values to be used by cdo
cdoConfig.Fields.Item(cdoSMTPServer) = "smtp.servername.com";
cdoConfig.Fields.Item(cdoSMTPServerPort) = 25;
cdoConfig.Fields.Item(cdoSendUsingMethod) = 2;
cdoConfig.Fields.Update();
// update the message configuration for cdo
cdoMessage.Configuration = cdoConfig;
cdoMessage.To = strMailTo;
cdoMessage.From = strMailFrom;
cdoMessage.Subject = strMailSubject;
cdoMessage.Cc = strMailCc;

// assign the body text for the message

cdoMessage.HTMLBody = strMailBody;
cdoMessage.AddAttachment('e:\\inetpub\\ cdoMessage.AddAttachment('e:\\inetpub\\ cdoMessage.AddAttachment('e:\\inetpub\\ cdoMessage.AddAttachment('e:\\inetpub\\ cdoMessage.AddAttachment('e:\\inetpub\\ cdoMessage.AddAttachment('e:\\inetpub\\ cdoMessage.AddAttachment('e:\\inetpub\\ cdoMessage.AddAttachment('e:\\inetpub\\ cdoMessage.AddAttachment('e:\\inetpub\\ cdoMessage.AddAttachment('e:\\inetpub\\// send the msg
cdoMessage.Fields.Update();
cdoMessage.Send();

// release the objects once done
cdoMessage = null;
cdoConfig = null;
}

I found a reference in the CDO.CHM file that refers to an Attachment Position property, but I cannot figure a way to try to use that as I read it, it wants the Character position, and I have no idea what that will be from email to email.

Any ideas would be appreciated.

Thanks in advance.

Dougc
 
First thing I would do is try using a different mail reading client to figure out if this was an issue with CDO or with Lotus Notes.

Try to send the message to another type of mail server and see what you get. Perhaps make a hotmail account to test it with if you don't have access to another mail reader.
 
Sheco

Thanks for the suggestion.

Had not thought to send it to another account will try that here in a few.

Have a great day.

Dougc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top