Archive for September, 2009

Microsoft Courier

So I recently saw the article posted on Gizmodo about the new Microsoft Courier, and I have to say I am really impressed and disappointed. I was saying impressed because of the simplicity and the amount of functionality that is available with the Courier. I was disappointed in the fact that Apple has been discussing a tablet laptop for a few months now and nothing has been made into a concept. I guess the hype alone might be good enough for some people but for people like me I actually need to see a working concept or even a simulation of a prototype. If you haven’t seen the video please check it out below.

Classic ASP to Excel

Have you ever wondered how to go from a Classic ASP page to Excel? I have done this a lot usually someone in the office will ask, “Can I have the total profit of the month in a spreadsheet?” now you can handle this one of two ways go and copy all the data from the database one by one or you can extract the data and spit it out using ASP to Excel.

<%
‘The line below lets the browser know this is an Excel File
Response.ContentType = “application/vnd.ms-excel”
%>
<table>
<thead>
<tr>
<th style=”background-color:#CCCCCC;color:#FFFFFF;”>First Name</font></th>
<th style=”background-color:#CCCCCC;color:#FFFFFF;”>Last Name</font></th>
</tr>
</thead>
<tbody>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
<tr>
<td>Steve</td>
<td>Smith</td>
</tr>
<tr>
<td>Frank</td>
<td>McCoy</td>
</tr>
</tbody>
</table>

Basically take the code above and paste it into your editor and save it as an ASP file run it and see the results.

Email Via Classic ASP

I know it has been a while since I sat down and wrote a decent post so tonight I figured let me discuss sending emails Classic ASP style. View the code below which will be explained in further detail:

<%
Dim strMailTo
Dim strMailSubject
Dim strMailBody
Dim objCDOMail ‘The CDO object

strMailSubject = “Test Via ASP”

strMailTo = Request.Form(”sendemail”)

strMailBody = “Hello World,”
strMailBody = strMailBody & “This is my first email.”
strMailBody = strMailBody & “Sent via ASP!!!”

Set objCDOMail = Server.CreateObject(”CDO.Message”)

objCDOMail.From = “mail@yourdomain.com”
objCDOMail.To = strMailTo
‘objCDOMail.Cc = “user@domain.com”
‘objCDOMail.Bcc = “user@domain.com”
objCDOMail.Subject = strMailSubject
objCDOMail.TextBody = strMailBody
objCDOMail.Send()
Set objCDOMail = Nothing
%>

Alright so the code above may looked complicated but it really isn’t. Basically the main part of this is the objCDOMail this is telling the server that you want to send a message via email. The variables dimed are just place holders for the objCDOMail parameters for example: strMailSubject is used to hold a string message for the subject line, objCDOMail.Subject.