Wednesday, 21 October 2009

MS Outlook: Not retrieving your style sheet

Scenario:

Have created a tool that generates a HTML email.
HTML email has references to Custom Style Sheets hosted on the corporate intranet.
The email is sent company wide to own domain and also to a child company with its own domain.
Cross domain trust is limited but the child company is able to access the parent intranet.
The email renders correctly on parent domain, but on child domain none of the styles came through.

Fix:

Seems like outlook was the culprit, and was blocking scripts on the email. This includes my reference to the stylesheet on the parent domain.

Needed to modify outlook to add sender as a safe sender in the junk mail filter list.

Steps to do this are outlined here:


Once the sender was added to the safe sender list, the email renders correctly.

If you double click on the email and click on "View" > "View in internet zone" the styles should also become visible.

Thursday, 8 October 2009

Active Directory: Query convention

Using ADs path format:
LDAP:<//server/o=organization/ou=site/cn=recipients>;
(objectClass=*);ADsPath,objectClass,cn;subtree"

Attribute name format:
<LDAP://server/cn=recipients,ou=site,o=organization>, _
(objectClass=*);ADsPath,objectClass;subtree

SAMPLE CODE:

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset

Set conn = New ADODB.Connection
conn.Provider = "ADSDSOObject"
conn.Open "ADs Provider"

Set rs = conn.Execute( _
"<LDAP://server/o=organization/ou=site/cn=recipients>;" _
& "(objectClass=*);ADsPath,objectClass,cn;subtree")

While Not rs.EOF
Debug.Print rs.Fields(0).Value, rs.Fields(1).Value, _
rs.Fields(2).Value
rs.MoveNext
Wend

conn.Close

Thursday, 1 October 2009

Javascript: Prevent editing in file input fields

add the following properties:

oncontextmenu='return false' onkeydown='this.blur()'