Solved

ASP script to add email field to outlook mail group

Posted on 2004-08-12
7
284 Views
Last Modified: 2008-03-06
Is there a way for an email entered into a text box to get added to a group assigned in Microsoft outlook program? A user of a asp web app I wrote wants the email to get added automatically when they create a new record so she can send email to everyone in the database.
0
Comment
Question by:cseink
7 Comments
 
LVL 3

Expert Comment

by:dwaldner
ID: 11785846
There probably is, but the easiest way is to export a VCard for import into Outlook.

I've done this before, I can provide code if you'd like...
0
 

Author Comment

by:cseink
ID: 11786787
Yes that would be great. Thanks
0
 
LVL 3

Accepted Solution

by:
dwaldner earned 500 total points
ID: 11786903
Steps to implement:

1.  Change the listed query...it only works for my code...but you need to provide a query that provides similar information (ie. first name, last name, address, etc.)

2.  Create a blank file called vcard.vcf and point the FILEPATH to point to it...

Hope you can make sense of it all

Dan

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

<!--#include virtual="/connections/connection.asp"-->
<%
  set rs = server.createObject("ADODB.RecordSet")
  rs.Open "SELECT * FROM [Committee Members Query] WHERE [committee member id] = '" & request("committee_member_id") & "'",my_Conn,3,3
  if not rs.eof then
    FILEPATH = "F:\websites\common\data_export\vcard.vcf"              
    Set fs = Server.CreateObject("Scripting.FileSystemObject")
    Set file = fs.GetFile(FILEPATH)
    file.Delete True
    set file = nothing
    Set writefile = fs.OpenTextFile(FILEPATH, 8, True)            
    writefile.writeline("BEGIN:VCARD")
    writefile.writeline("N:"& rs("last name") & ";" & rs("first name"))    
    writefile.writeline("FN:"& rs("first name") & " " & rs("last name"))
    writefile.writeline("CATEGORIES:" & rs("committee name"))
    writefile.writeline("NOTE;ENCODING=QUOTED-PRINTABLE:" & rs("position") & "=0D=0A")
    ADR = ""
    if rs("organization address 1") <> "" then
      if rs("organization address 1") <> "" then
        ADR = ADR & ";" & rs("organization address 1")
      end if
      if rs("organization address 2") <> "" then
        ADR = ADR & ";" & rs("organization address 2")
      end if
      if rs("organization city") <> "" then
        ADR = ADR & ";" & rs("organization city")
      end if
      if rs("organization province") <> "" then
        ADR = ADR & ";" & rs("organization province")
      end if
      if rs("organization postal code") <> "" then
        ADR = ADR & ";" & rs("organization postal code")
      end if
    end if
    if ADR <> "" then
      writefile.writeline("ADR:" & ADR)
    end if
    if rs("organization phone") <> "" then
      writefile.writeline("TEL;WORK:" & rs("organization phone"))
    end if
    if rs("home phone") <> "" then
    writefile.writeline("TEL;HOME:" & rs("home phone"))
    end if
    if rs("organization email") <> "" then
    writefile.writeline("EMAIL;INTERNET:" & rs("organization email"))
    end if
    if rs("title") <> "" then
    writefile.writeline("TITLE:" & rs("title"))
    end if
    if rs("organization name") <> "" then
    writefile.writeline("ORG:" & rs("organization name"))
    end if
    writefile.writeline("END:VCARD")
  end if
  rs.Close
  set rs = Nothing
  response.redirect("/common/data_export/vcard.vcf")
 %>
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 11

Expert Comment

by:sciber_dude
ID: 11787362
dwaldner's solution works! He has given you the answer.

But if you want a tutorial, here is a good read http://www.devx.com/getHelpOn/10MinuteSolution/20508

(read all 4 pages and this solution is a little different from dwaldner's but basically the same thing)

:) SD
0
 
LVL 11

Expert Comment

by:sciber_dude
ID: 11787373
oops! my solution was for a vCalendar! never mind!

U can say that its been a long day for me! Phew!
:) SD
0
 

Expert Comment

by:Minessence
ID: 12924114
Do you have a similar solution for .net?
0
 
LVL 11

Expert Comment

by:sciber_dude
ID: 12925861
sorry, i am not a .Net guy. so i dont.

:) SD
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Response.Flush in Classic ASP causing TIME_WAIT ports 9 96
Want the count number from this QUery 2 49
Server Timeout with Loop 6 45
Index on a Table 6 11
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

776 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