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

CDO Saving send message to sent items

Status
Not open for further replies.

Albano

Instructor
Dec 11, 2000
221
PT
Hi,

Anyone knows how can I make cdo save a copy of the sent message to set items.

Thanks,

Albano

This the code I'm using:

Dim objCDO
Dim iConf
Dim Flds

SET rsDadosMail= NOTHING
strSQLMail="SELECT * FROM configEmail WHERE tipoMail=4" 'Email do tipo reporting diário
retorno = sqlSelect(objConn, strSQLMail, rsDadosMail, "exportExcel.asp - #4")

remetente=trim(rsDadosMail("remetenteMail"))
destinatario=trim(destino)
campoCc=""'trim(rsDadosMail("cc"))
campoBcc=""'trim(rsDadosMail("bcc"))
assunto=trim(rsDadosMail("assunto"))
mensagem=rsDadosMail("mensagem")

nomeFicheiro = "/exportacao/" & codTier & ".xls"
nFicheiro = Server.MapPath(nomeFicheiro)

Const cdoSendUsingPort = 2

Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
'Set objSentItems = objSess.GetDefaultFolder(3)


Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) ="GEAC01XBAL5"
.Item(cdoSMTPAccountName) = "pedro.rodrigues@gefco.pt"

.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With

Set objCDO.Configuration = iConf

objCDO.From = remetente
objCDO.To = destinatario
objCDO.cc = campoCc
objCDO.bcc = campoBcc
objCDO.Subject = assunto
objCDO.TextBody = mensagem

objCDO.AddAttachment nFicheiro

objCDO.Send

'Cleanup
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing

 
the cdonts component doesnt work like that. it is a iis module and doesnt in essance have a 'sent items folder' it would be difficult to write a script that duplicates whats in thepick up folder as that is the only place to catch mail from cdonts component.



Glen
Conception | Execution
 
But, I'm not using CDONT, i'm using CDO (Colaborations Objects)

Can this be possible with CDO ?

Thanks
Albano
 
there's a clue in the name.

CDONT Collaboration Data Objects for NT

CDOSYS Collaboration Data Objects is the new dll for Windows 2000 and above



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top