Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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 May 5th, 2005, 12:47 PM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chocobabe100 Send a message via Yahoo to chocobabe100
Default ASpMail

  Hi..
        I tried sending a mail with an attachment . I am able to attach a .jpeg as well as .pdf file to the mail but the prob is when i try to attach and send a .doc file . i am storing the path of the file selected thru a browse option and then attaching that file to the mail with mailer.addattachment. It gives the correct path but does not attach the .doc file..
           Can some one please help me out ?
            Thanx
            Chocobabe

 
Old May 5th, 2005, 11:27 PM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chocobabe100 Send a message via Yahoo to chocobabe100
Default

my code is as follows
if lsIsMail = "YES" then
            AppTo = request.Form("txtAppTo")
            AppCC = request.Form("txtAppCC")

            AppSubject = request.Form("txtAppSubject")
            AppText = request.Form("txtAppText")
            AppText = AppText & "<br><br><a href=""" & Application("ApplURL") & "/Add-sample.asp?SID=" & lsSampleID & "&TaskID=" & lsTaskID & """>Click here to view page</a>"

            SendTo = request.Form("txtSendTo")
            SendCC = request.Form("txtSendCC")

            SendSubject = request.Form("txtSendSubject")
            SendText = request.Form("txtSendText")
            SendText = SendText + "<br><br><a href=""" & Application("ApplURL") & "/Add-sample.asp?SID=" & lsSampleID & "&TaskID=" & lsTaskID & """>Click here to view page</a>"

            EnableMail = session("EnableMail")
            if EnableMail then
                if AppTo <> "" then
                    RecipientName = AppTo
                    RecipientAddress = AppTo
                    sendBCC = request.Form("txtAppBCC")
                    attachfname = request.Form("txtAttach1")
                else
                    RecipientName = SendTo
                    RecipientAddress = SendTo
                    sendBCC = request.Form("txtSendBCC")
                    attachfname = request.Form("txtAttach2")

                end if
      if AppTo <> ""
GoMail =
sendMessage (RecipientName,RecipientAddress,AppCC,sendBCC,AppS ubject, replace(AppText,chr(13),"<br>"),attachfname)


Function sendMessage(MailToName,mailTo,MailCC,MailBCC,mailS ubject,mailBody,attachFname)

    Set mailer = Server.CreateObject("SMTPsvg.Mailer")
    mailer.FromName = "WebMaster of Biodar"
    mailer.FromAddress = "[email protected]"
    mailer.RemoteHost = "199.200.213.1:50"



    mailer.AddRecipient MailToName, mailTo
    mailer.AddCC MailCC,MailCC
    mailer.AddBCC MailBCC,MailBCC
    mailer.Subject = mailSubject
    mailer.ReplyTo = MailBCC
    mailer.BodyText = mailBody
    mailer.AddAttachment (attachFname)
    mailer.ContentType = "text/html"
    Mailer.Priority = 3 ' 1 = High, 3 = Normal, 5 = Low

    If mailer.Sendmail then ' Send message
        sendMessage = True ' Email was sent ok, return True
    else ' Send Failure
        sendMessage = mailer.Response ' Return error message
    end if
end function







Similar Threads
Thread Thread Starter Forum Replies Last Post
aspMail Morn Classic ASP Basics 3 February 26th, 2007 06:51 PM
aspMail Morn ASP.NET 2.0 Basics 1 February 25th, 2007 09:40 PM
ASPMail embaded images kalpitkk Classic ASP Professional 1 January 9th, 2006 01:06 PM
ASPMail / Shift_JIS jz552 Classic ASP Professional 0 May 4th, 2005 02:39 PM
AspMail mmarkym Classic ASP Components 2 December 21st, 2003 01:36 PM





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