Solved

ASP script to add email field to outlook mail group

Posted on 2004-08-12
7
286 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 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