Solved

ASP script to add email field to outlook mail group

Posted on 2004-08-12
7
280 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ASP VB... 7 93
Classic ASP - cannot get to correct path 17 62
Group by correlation 4 43
INNER JOIN ? 8 33
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now