Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 5th, 2005, 12:47 PM
Registered User
 
Join Date: May 2005
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old May 5th, 2005, 11:27 PM
Registered User
 
Join Date: May 2005
Location: , , .
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 = "abc@mymail.com"
    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


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:27 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.