A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Sending an E-mail

  1. #1
    Senior Member
    Join Date
    Jul 2000
    Posts
    224
    I know that on HTML that you could make a tag:
    Code:
    <form method=POST action="mailto:bla@bla.com">
    
    where bla@bla.com is an e-mail address
    Is it posible to do that with Flash? I know you could do it via CGI, but I don't want it to use a CGI or any varient of it. Also, I tried

    Code:
    Geturl "mailto:bla@bla.com?subject=register?body=" & email
    
    where bla@bla.com is an e-mail address and email is a text field that has an email address to be sent.
    Thank you very much in advance

  2. #2
    President, save the
    New Zealand dollar foundation

    Join Date
    Jun 2000
    Posts
    1,743
    That will work, but will open the hosts default mail program, rather than automatically send - you need CGI to get around this (as far as I know, if anyone can get it send without opening the email window PLEASE post it )

  3. #3
    President, save the
    New Zealand dollar foundation

    Join Date
    Jun 2000
    Posts
    1,743
    Your code is a bit wrong though body is the message body of the email form, if you put an address in there it won't get sent (or are you just trying to retrieve the users info?) the code:
    Get URL"mailto:bla@bla.com?subject=register&body="&ema il&""
    The action needs to be an expression so that flash can evaluate the variable rather than taking the value literally.

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Posts
    108

    try a simple ASP or CF script

    Hello,

    as far as i know sonwah is right - you need some kind of CGI script.

    You might want to try a simple asp or Coldfusion script.

    Both have tags that will handle sending an email very easily.

    I can send you a cf one if you'd like.

    Best Rgds,

    Bryan

  5. #5
    Senior Member
    Join Date
    Jul 2000
    Posts
    224
    I'm not sure about CGI b/c I just recently set up my website and I don't know how to put a cgi on it.

    If you could please tell me, I'll be gratefull.

    Thanks

  6. #6
    Senior Member
    Join Date
    Jun 2000
    Posts
    108

    CGI

    I don't have a cgi for you, but if your server supports coldfusion, i can send you a template that will send out an email.

    Let me know,

    Bryan

  7. #7
    Senior Member
    Join Date
    Jun 2000
    Posts
    108

    CGI

    Oh, i almost forgot.

    You might want to check with your webhost - most of them provide some basic cgi's that might be able to help you out.

  8. #8
    Junior Member
    Join Date
    Mar 2000
    Posts
    19
    You can pass the variables out to an ASP page which uses CDONTS to build the email message.



    Here is the code we are using....

    I have removed the names and IP address to protect the innocent.

    This is the page that the variables are sent to. Use Request.form to grab the values from the flash movie and then build the email.

    ----------------------------------------------------------

    <%@ LANGUAGE=vbscript enablesessionstate=false LCID=1033 %>

    <%
    Response.CacheControl="Public"
    Response.ExpiresAbsolute=DateAdd("yyyy", -10, Date)
    Response.Buffer = True


    Dim strFlashName
    Dim strRequestName

    strRequestName = Request.QueryString("flashfile")

    Select Case strRequestName

    Case "file1.swt"
    strFlashName = "bla"
    Case "file2.swt"
    strFlashName = "blabla"
    Case "file3.swt"
    strFlashName = "blablabla"

    End Select

    'Initiate the CDONTS
    aHTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCRLF
    aHTML = aHTML & "<html>" & vbCRLF
    aHTML = aHTML & "<head>" & vbCRLF
    aHTML = aHTML & "<meta http-equiv=""Content-Type"" "
    aHTML = aHTML & "content=""text/html; charset=iso-8859-1"">" & vbCRLF
    aHTML = aHTML & "</HEAD>" & vbCRLF
    aHTML = aHTML & "<body bgcolor=#ffffff>" & vbCRLF
    aHTML = aHTML & "<P><H3>Dear " & Request.QueryString("contact") & ",<P></H3>" & vbCRLF
    aHTML = aHTML & Request.QueryString("emailbody") & vbCRLF
    aHTML = aHTML & "<p>Please review our demo at:<br> " & vbCRLF
    aHTML = aHTML & "<p><a href='http://your.website.com/'>http://your.website.com/</a><br><p> " & vbCRLF

    aHTML = aHTML & "<OBJECT classid="
    aHTML = aHTML & chr(34)
    aHTML = aHTML & "clsid27CDB6E-AE6D-11cf-96B8-444553540000"
    aHTML = aHTML & chr(34)
    aHTML = aHTML & " codebase="
    aHTML = aHTML & chr(34)
    aHTML = aHTML & "http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"
    aHTML = aHTML & chr(34)
    aHTML = aHTML & " ID=smintro WIDTH=100% HEIGHT=100%" & "> <PARAM NAME=movie VALUE="
    aHTML = aHTML & chr(34)
    aHTML = aHTML & "http://your.website.com"
    aHTML = aHTML & Request.QueryString("flashfile")
    aHTML = aHTML & "?company="
    aHTML = aHTML & Request.QueryString("company")
    aHTML = aHTML & "&contact="
    aHTML = aHTML & Request.QueryString("contact")
    aHTML = aHTML & chr(34)
    aHTML = aHTML & "> <PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000000> "
    aHTML = aHTML & "<EMBED src="
    aHTML = aHTML & chr(34)
    aHTML = aHTML & "http://your.website.com/flash/smpromo/smintro.swt?company="
    aHTML = aHTML & Request.QueryString("company")
    aHTML = aHTML & "&contact="
    aHTML = aHTML & Request.QueryString("contact")
    aHTML = aHTML & chr(34)
    aHTML = aHTML & " loop=false quality=high bgcolor=#000000 WIDTH=100% HEIGHT=100% TYPE="
    aHTML = aHTML & chr(34)
    aHTML = aHTML & "application/x-shockwave-flash"
    aHTML = aHTML & chr(34)
    aHTML = aHTML & " PLUGINSPAGE="
    aHTML = aHTML & chr(34)
    aHTML = aHTML & "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
    aHTML = aHTML & chr(34)
    aHTML = aHTML & "><br>"

    aHTML = aHTML & "</body>" & vbCRLF
    aHTML = aHTML & "</html>"

    '--------------------------------------------------------------------
    ' Instantiate the CDONTS component
    Set objMail = Server.CreateObject("CDONTS.Newmail")

    '--------------------------------------------------------------------
    ' Send email
    if Request.QueryString("fromemailaddress") = "" then
    objMail.From = "youremail@your.com"
    else
    objMail.From = Request.QueryString("fromemailaddress")
    end if


    objMail.To = Request.QueryString("toemailaddress")
    objMail.Cc = Request.QueryString("ccemailaddress")
    objMail.Subject = Request.QueryString("subject")
    objMail.BodyFormat = 0
    objMail.MailFormat = 0
    objMail.Body = aHTML
    objMail.Send

    ' Release the CDONTS component to free resources
    Set objMail = Nothing
    Response.Clear
    if Request.QueryString("typeofmail") = "demo" then
    Response.Redirect ("bla.asp")
    else
    Response.Redirect ("bla.asp")
    end if

    %>






    If you need more info contact me.

    Flashmonkey

  9. #9
    Senior Member
    Join Date
    Jul 2000
    Posts
    224
    well...I still don't know what file to upload to my site. Do I just write that on notepad and save it as .cgi and upload it? and also, I read through it and saw a .swt, but that is Macromedia Generator format. I use SWF. WHat do I do?

  10. #10
    Junior Member
    Join Date
    Mar 2000
    Posts
    19

    It is an ASP page

    That is not a CGI script.

    It is an ASP page that uses CDONTS.

    We use SWT files but you can use swf files if you like.

  11. #11
    Senior Member
    Join Date
    Jul 2000
    Posts
    672

    hi

    If you need a cgi script just to have a user send you mail I have one that I am using on my site. I will tell you how to set it up. You have to make sure that your host supports cgi. The script I have is written in perl.

    email me if you need it....

    DRB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center