Sending a ringtone with ASP CDO

Posted on 2009-02-12
Last Modified: 2013-11-13
I am trying to set up my webpage to send a ringtone to an phone number from a form.
I'm sending the Email with the CDO method and trying to send the .MP3 ringtone as an attachement.
I'm getting thrown an error message:
"Brief Description: The system cannot locate the resource specified. "
Although if I paste the Url in my browser the .mp3 file is located there.

Set myMail=CreateObject("CDO.Message")

myMail.Subject="Oorah's Ringtone"


myMail.To= ""

myMail.TextBody="Here is Oorah's Ringtone. Save and set up as a ringtone."

myMail.AddAttachment ""


set myMail=nothing

Open in new window

Question by:rivkamak
    LVL 22

    Expert Comment


    You can add an attachment using a virtual path. You need to specify physical path for an attachment. In current scenario, you can write script to download mp3 file at server in a temporary folder and then attach it to the email you are sending out.

    Hope it makes sense
    LVL 3

    Expert Comment

    Hi Rivkamak,

    To download an MP3 file from ASP you need to use something like the below
    (taken from

    Dim oWinHTTP
    Dim oStream

    Set oWinHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")

    oWinHTTP.Open "GET", "", False

    If oWinHTTP.Status = 200 Then
    Set oStream = CreateObject("ADODB.Stream")
    oStream.Type = 1
    oStream.Write oWinHTTP.responseBody
    oStream.SaveToFile Server.MapPath("/localDir/cellRing.mp3")
    End If

    You then use the

    myMail.AddAttachment "c:\pathtolocaldir\cellRing.mp3"
    Hopefully this will get you going?

    LVL 30

    Expert Comment

    by:Wayne Barron

    Author Comment

    When someone runs the ASP script is causes the MP3 to be temporarily saved on His local computer or onto the server's local computer?

    Author Comment

    Why would I be getting an error message:
    A connection with the server could not be established  
    coming from line."oWinHTTP.Send"
    LVL 3

    Accepted Solution



    When the ASP script is run then it saves the file to the SERVER not the users PC.

    ASP is a server side scripting language which means everything happens on the server.

    I am not sure why you are getting that error, is the URL correct?
    What happens if you go to that link through a browser?

    Author Comment

    Yes, that link works fine when typed in a browser.
    Do I need specific setting to allow the temp. write on the servers' folder?
    LVL 3

    Expert Comment


    Regarding your error, I will need to investigate and have a look, give me afew days as I am away from my dev system over the weekend.

    The IIS account will ned write permissions to whatever folder you are saving it onto.
    I think its the IWAM_servername account that's used by ASP.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    This is about my first experience with programming Arduino.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now