User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 402,461 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,975 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting

Ecard:MHTML -v- linked HTML

Join Date: Oct 2006
Posts: 3
Reputation: eogmp3 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
eogmp3 eogmp3 is offline Offline
Newbie Poster

Re: Ecard:MHTML -v- linked HTML

  #2  
Oct 22nd, 2006
Hi again. I've been messing around here and think i'm getting somewhere. Unfortunately I can't access the actual server that I'll be using at present (I will tomorrow at work) and I can't seem to get my localhost to process CDOSYS (browser gives the following error :Error Type:CDO.Message.1 (0x80070005). Access is denied. /ecard/html4.asp, line 25). This means that I can't really test out what i'm doing.

Can someone tell me if I'm on the right track with this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<% 
    dim MyMail, strHtmlBody

    SMTPServer = "localhost"  
    cdoURL = "http://schemas.microsoft.com/cdo/configuration/"  
       
    Set MyMail = CreateObject("CDO.Message") 
     
    Set cdoC = CreateObject("CDO.Configuration")  
    Set cdoF = cdoC.Fields  
 
    With cdoF  
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2  
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False  
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60  
        .Update  
    End With  
 
strHtmlBody = strHtmlBody & "<HTML>"
strHtmlBody = strHtmlBody & "<p align="center"> Hello <% response.write(request.form("rName"))%>, <% response.write(request.form("sName"))%> has sent you this ecard:"
strHtmlBody = strHtmlBody & "<img src=""http://www.mysite.com/images/ecard1.jpg""></p>"
strHtmlBody = strHtmlBody & "<b>Message:</b><% response.write(request.form("body"))%>"
strHtmlBody = strHtmlBody & "<p><a href=""http://www.mysite.com/ecard.asp"">click here</a> to send your own ecard."
strHtmlBody = strHtmlBody & "<p>Thank you</p>"
 
    With MyMail 
        Set .Configuration = cdoC  
                
        .From = Request("sAddress")  
        .To = Request("rAddress")   
        .Subject = "Test"
        .HTMLBody = strHtmlBody 
        .Send  
    End With  
 
    Set MyMail = Nothing  
    Set cdoS = Nothing  
    Set cdoF = Nothing  
%>




Your ecard has been sent. Thank you!
</body>
</html>

Much appreciated.
-eogmp3
Last edited by eogmp3 : Oct 22nd, 2006 at 1:45 pm.
Reply With Quote  
All times are GMT -4. The time now is 3:54 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC