Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2004, 08:46 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default Mail attachments

Hi friends,

  what is the problem with this code

set sndMail=server.createobject("CDONTS.newmail")
sndMail.attachment "....",1

I am able to send thru my win2000 server locally. when i host its not working. I am able to send mail without attachements at both the places. Only attachments cannot send thru host server.

Thanx

 
Old March 12th, 2004, 12:20 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hello check this code
<%
Dim objet_NewMail

Set objet_NewMail = CreateObject("CDONTS.NewMail")

Contenu = "" _
         & "<html>" _
         & "<head>" _
         & "<title>Welcome to suren</title>" _
         & "</head>" _
         & "<body>" _
         & "<h1>hi</h1>" _
         & "<p>visit <a href="www.trustnetmarketing.com" target="_blank">http://www.trustnetmarketing.com"</a></p> _
         & "</body>" _
         & "</html>"
objet_NewMail.From = "[email protected]"
objet_NewMail.To = "[email protected]"
objet_NewMail.Subject = "Courrier électronique"
objet_NewMail.BodyFormat = 1
objet_NewMail.MailFormat = 1
objet_NewMail.Body = Contenu
objet_NewMail.Importance = 2
objet_NewMail.AttachFile = "c:\suren.doc", "Pièce jointe"
objet_NewMail.Send

Set objet_NewMail = Nothing
%>
 
Old March 13th, 2004, 02:48 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

    dim mailto,mailfrom,subj,mailbody,sndMail
    mailto=request("txt1")
    mailfrom=request("txt2")
    subj=request("txt3")
    mailbody=request("txt4")
    set sndMail=server.CreateObject("CDONTS.NewMail")
    sndMail.To=mailto
    sndMail.From=mailfrom
    sndMail.Subject=subj
    sndMail.BodyFormat=0
    sndMail.Importance=2
    sndMail.MailFormat=0
    mailbody=replace(mailbody,chr(13),"<br>")
    sndMail.Body=mailbody

    dim strFiles,arrFiles,filePath
    strFiles=request("txtHFiles")
    arrFiles=split(strFiles,",")

    for i=0 to ubound(arrFiles)-1
        filePath=Request.ServerVariables("APPL_PHYSICAL_PA TH") & "uploads\" & arrFiles(i)
        sndMail.AttachFile filePath,arrFiles(i),1
    next

    sndMail.Send
    set sndMail=nothing



Wats problem with this code. i am unable to attach files. Its working fine in my own system(win 2000 server) but not from site. i uploaded files to site using ASPSmartUpload control to uploads folder in the site










Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
E-Mail Attachments kidbass Beginning VB 6 0 October 26th, 2006 06:30 AM
Mail with Attachments software_developer_kk Classic ASP Basics 1 March 31st, 2005 12:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.