[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

Sending a ringtone with ASP CDO

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.From="devorah.fleisher@oorah.org"
myMail.To= "devorah@cucumber.com"
myMail.TextBody="Here is Oorah's Ringtone. Save and set up as a ringtone."
myMail.AddAttachment "http://www.oorah.org/auction/2009/mp3/cellRing.mp3"
myMail.Send
set myMail=nothing

Open in new window

0
rivkamak
Asked:
rivkamak
1 Solution
 
neeraj523Commented:
Hello

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
0
 
ajnt__Commented:
Hi Rivkamak,

To download an MP3 file from ASP you need to use something like the below
(taken from http://bytes.com/groups/asp/603227-msxml2-serverxmlhttp-works-only-text-files)

Dim oWinHTTP
Dim oStream

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

oWinHTTP.Open "GET", "http://www.oorah.org/auction/2009/mp3/cellRing.mp3", False
oWinHTTP.Send

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

You then use the

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

0
 
Wayne BarronCommented:
listening...
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
rivkamakAuthor Commented:
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?
0
 
rivkamakAuthor Commented:
Why would I be getting an error message:
A connection with the server could not be established  
coming from line."oWinHTTP.Send"
0
 
ajnt__Commented:

Hi

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?
0
 
rivkamakAuthor Commented:
Yes, that link works fine when typed in a browser.
Do I need specific setting to allow the temp. write on the servers' folder?
0
 
ajnt__Commented:

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.

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now