[Mrpostman-developers] Creating attachments and referencing from an email
Brought to you by:
chris_humphreys,
mrbook
|
From: Jon D. <jon...@gm...> - 2006-03-16 00:09:12
|
Hi all,
I'm currently updating the outlook 2003 script and I have a couple of
questions about attachments. When receiving email, I am detecting if the
incoming email is an event invite and saving out the raw ICS information to
the filesystem as a file that is available via a local web server and then
creating a new attachment, refering to the URL of the file. Once the email
has been downloaded, the temporary attachment can be deleted. I was
wondering if there is a way of creating an attachment entirely in memory, o=
r
possibly just with access to a tmp directory? The way i'm implementing thi=
s
currently is shown below:
# JD If this is a meeting invite, get the raw email using header
Translate=3Df, extract the invite as an ICS
# and add as an attachment
pattern_invite=3D"\?Cmd=3Daccept\" title=3D\"Accept\""
found =3D match(page,pattern_invite)
if (found)
params[""] =3D ""
headers["Translate"] =3D "f"
status,page =3D get(replaceall(replaceall(msg.id,"\\[","%5B"), "\\]=
",
"%5D"),params,headers)
pattern_ics=3D"(BEGIN:VCALENDAR.+END:VCALENDAR)"
icsfound,ics=3Dmatch(page,pattern_ics)
# Now write the ics file to a web shared folder to allow a link to
be added
# TODO find a better way of doing this, this is stupid
writefile("/Users/jon/Sites/mail/meeting.ics", ics)
msg.attachments[0].text=3D"meeting.ics"
msg.attachments[0].link=3D"http://localhost/~jon/mail/meeting.ics"
end
Hopefully this code makes it clear what i'm currently doing.
My second question is related to the first. I am trying to find a way of
displaying embedded images within emails. As it currently stands, the
embedded images are displayed in OWA as links relative to the email. What =
I
would like to do is download the images, create attachments (hopefully in
the same manner as above), and then rewrite the email image links to link t=
o
the attachments from within the email. Anyone have any ideas?
Cheers,
Jon
PS - the wiki is currently unavailable:
lib/WikiDB/backend/PearDB.php:32: Fatal[256]: Can't connect to database:
wikidb_backend_mysql: fatal database error
- DB Error: connect failed
- ( [nativecode=3DCan't connect to MySQL server on '
mysql.sourceforge.net' (111)] **
mysql://mrpostman:XXX...@my.../mrpostman)
|