Problem with HTML email (1 Viewer)

UniqueTII

What?
Local time
Today, 02:33
Joined
Apr 4, 2002
Messages
96
I have a sub set up to send an HTML email, and when I send it to myself on my Outlook account, it comes through fine, but when I send it to any other account, it comes through as just text. The message is formatted correctly in my sent items folder...it just shows up wrong wherever I send it. If I forward the message from my sent items folder to any of my accounts, that works fine too. It's only when the function sends the email that it comes through as text.

Can someone please help me out?

Here's the code:
Code:
Private Sub Command0_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim rs2 As DAO.Recordset
Dim email As String
Dim olApplication As Outlook.Application
Dim olns As Outlook.NameSpace
Dim myItem As Outlook.MailItem




Set db = CurrentDb()
Set rst = db.OpenRecordset("tblEmailSend")
Set rs2 = db.OpenRecordset("tblEmailHTML")
rst.MoveFirst
Do While Not (rst.EOF)

Set olApplication = CreateObject("Outlook.Application")
Set olns = olApplication.GetNamespace("MAPI")
Set myItem = olApplication.CreateItem(olMailItem)
myItem.HTMLBody = rs2.Fields("html").Value
myItem.To = rst.Fields("E-mail")
myItem.Subject = "MASEA Student Employment Survey "
myItem.Send
rst.MoveNext
Loop
rst.Close
rs2.Close
Set db = Nothing
End Sub
 

UniqueTII

What?
Local time
Today, 02:33
Joined
Apr 4, 2002
Messages
96
and here's the HTML:
Code:
<HTML>
<HEAD>
<TITLE>MASEA Survey</TITLE>
</HEAD>
<BODY bgcolor=#c6b5de>
<TABLE BORDER=0 BGCOLOR="gray" WIDTH=100%>
  <TR>
    <TD ALIGN="center"><b>MASEA CONFERENCE QUESTIONAIRE</b></TD>
  </TR>
</TABLE><P>
<!-- Following must point to the cgi server -->
<FORM ACTION="http://www.cgi.iastate.edu/cgi-bin/sfajobs/posad" METHOD="POST";>
<INPUT TYPE=HIDDEN NAME="_NEXTPAGE" VALUE="http://www.public.iastate.edu/~fin_aid_info/forms/employ-forms/survey_thankyou.html">
<INPUT TYPE=HIDDEN NAME="_SUBJECT"  VALUE="MASEA Survey Response">
<br>
Dear Colleague:<p>
The Midwest Association of Student Employment Administrators (MASEA) needs your help!  
As the Vice President for Professional Development for the organization, I've been asked to survey student employment professionals in the fourteen-state Midwest region.  
We're seeking input to help us better serve our members, as well as others in the region who help make part-time employment a rewarding experience for college students.
 
Please take a few minutes and complete the following questionnaire--we value your opinions!<p><br>


<br>
1. Are you planning to attend the 2003 MASEA conference?
<ul>
<input type = "radio" name = "Attend" value = "Yes, I plan to attend.">Yes, I plan to attend.
<br><input type = "radio" name = "Attend" value = "Yes, I plan to attend if it's within driving distance.">Yes, I plan to attend if it's within driving distance.
<br><input type = "radio" name = "Attend" value = "Maybe, it depends on the dates of the conference.">Maybe, it depends on the dates of the conference.
<br><input type = "radio" name = "Attend" value = "No, I do not plan to attend.">No, I do not plan to attend.
<br><input type = "radio" name = "Attend" value = "Other.">Other, please indicate.    <input type = "text" width = 50 name = "other_attend">
</ul> 
<p>
2. What is your preference for days the conference is held?
<ul>
<input type = "radio" name = "Days" value = "Sunday through Tuesday morning.">Sunday through Tuesday morning.
<br><input type = "radio" name = "Days" value = "Wednesday through Friday morning.">Wednesday through Friday morning.
<br><input type = "radio" name = "Days" value = "Other">Other, please indicate.   <input type = "text" width = 50 name = "other days">
</ul>
<p>
3. Do you plan on attending the 2003 NSEA conference in Hawaii?
<ul>
<input type = "radio" name = "Hawaii_Attend" value = "Yes.">Yes.
<br><input type = "radio" name = "Hawaii_Attend" value = "No.">No.
<br><input type = "radio" name = "Hawaii_Attend" value = "Undecided.">Undecided.
</ul>
4. Which MASEA conferences have you attended?
<ul>
<input type = "checkbox" name = "Last_Conference" value = "Cleveland 2002.">Cleveland 2002 (with NSEA).
<br><input type = "checkbox" name = "Last_Conference" value = "Kansas City 2001.">Kansas City 2001.
<br><input type = "checkbox" name = "Last_Conference" value = "Milwaukee 2000.">Milwaukee 2000.
<br><input type = "checkbox" name = "Last_Conference" value = "Beachwood 1999.">Beachwood 1999.
<br><input type = "checkbox" name = "Last_Conference" value = "Indianapolis 1998.">Indianapolis 1998 (with NSEA).
<br><input type = "checkbox" name = "Last_Conference" value = "Other">Other, please indicate:   <input type = "text" width = 50 name = "other conference">
</ul>
5. What would you consider to be a reasonable conference registration fee (assume one reception, three breakfasts, two lunches, and one dinner)?
<ul>
<input type = "radio" name = "Registration_Fee" value = "Less than $200.">Less than $200.
<br><input type = "radio" name = "Registration_Fee" value = "$200 - $250.">$200 - $250.
<br><input type = "radio" name = "Registration_Fee" value = "$250 - $300.">$250 - $300.
<br><input type = "radio" name = "Registration_Fee" value = "$300 - $350.">$300 - $350.
<br><input type = "radio" name = "Registration_Fee" value = "Does not matter.">Does not matter.
<br><input type = "radio" name = "Registration_Fee" value = "Other.">Other, please indicate:   <input type = "text" width = 50 name = "other_registration_fee">
</ul>
<P>
6. What is most important to you in a conference?<br>
<table width = 750>
<tr>
<td width = 375 align = center> </td>
<td width = 125 align = center>not important</td>
<td width = 125 align = center>somewhat important</td>
<td width = 125 align = center>very important</td>
</tr>
<tr>
<td><b>Issues</b></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Program</td>
<td align = center><input type = "radio" name = "Program" value = "Not Important"></td>
<td align = center><input type = "radio" name = "Program" value = "Somewhat Important"></td>
<td align = center><input type = "radio" name = "Program" value = "Very Important"></td>
</tr>
<tr>
<td>Networking opportunities</td>
<td align = center><input type = "radio" name = "Networking opportunities" value = "Not Important"></td>
<td align = center><input type = "radio" name = "Networking opportunities" value = "Somewhat Important"></td>
<td align = center><input type = "radio" name = "Networking opportunities" value = "Very Important"></td>
</tr>
<tr>
<td>Chance to discuss issues with colleagues</td>
<td align = center><input type = "radio" name = "Chance to discuss issues with colleagues" value = "Not Important"></td>
<td align = center><input type = "radio" name = "Chance to discuss issues with colleagues" value = "Somewhat Important"></td>
<td align = center><input type = "radio" name = "Chance to discuss issues with colleagues" value = "Very Important"></td>
</tr>
<tr>
<td>Get out of the office</td>
<td align = center><input type = "radio" name = "Get out of the office" value = "Not Important"></td>
<td align = center><input type = "radio" name = "Get out of the office" value = "Somewhat Important"></td>
<td align = center><input type = "radio" name = "Get out of the office" value = "Very Important"></td>
</tr>
<tr>
<td><b>Site</b></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Proximity to your campus</td>
<td align = center><input type = "radio" name = "Proximity to your campus" value = "Not Important"></td>
<td align = center><input type = "radio" name = "Proximity to your campus" value = "Somewhat Important"></td>
<td align = center><input type = "radio" name = "Proximity to your campus" value = "Very Important"></td>
</tr>
<tr>
<td>City attractions</td>
<td align = center><input type = "radio" name = "City attractions" value = "Not Important"></td>
<td align = center><input type = "radio" name = "City attractions" value = "Somewhat Important"></td>
<td align = center><input type = "radio" name = "City attractions" value = "Very Important"></td>
</tr>
<tr>
<td>Hotel facilities</td>
<td align = center><input type = "radio" name = "Hotel facilities" value = "Not Important"></td>
<td align = center><input type = "radio" name = "Hotel facilities" value = "Somewhat Important"></td>
<td align = center><input type = "radio" name = "Hotel facilities" value = "Very Important"></td>
</tr>
</table>
<P>
7. In an effort to reduce conference costs and registration fees, would you be inerested in attending a conference held on a school 
campus or other inexpensive location which may not offer the amenities normally associated with a large hotel?
<ul>
<input type = "radio" name = "On_campus" value = "Yes.">Yes.
<br><input type = "radio" name = "On_campus" value = "No.">No.
</ul>
8. Please indicate the type of institution at which you work:
<ul>
<input type = "radio" name = "Institution_type" value = "Private four year.">Private four year.
<br><input type = "radio" name = "Institution_type" value = "Private two year.">Private two year.
<br><input type = "radio" name = "Institution_type" value = "Public four year.">Public four year.
<br><input type = "radio" name = "Institution_type" value = "Community college.">Community college.
<br><input type = "radio" name = "Institution_type" value = "Proprietary.">Proprietary.
<br><input type = "radio" name = "Institution_type" value = "Other.">Other, please indicate:   <input type = "text" width = 50 name = "other_institution">
</ul>
9. Number of years working in student employment?
<ul>
<input type = "radio" name = "Years" value = "Less than 1 year.">Less than 1 year.
<br><input type = "radio" name = "Years" value = "1-3 years.">1-3 years.
<br><input type = "radio" name = "Years" value = "4-5 years.">4-5 years.
<br><input type = "radio" name = "Years" value = "6-10 years.">6-10 years.
<br><input type = "radio" name = "Years" value = "More than 10 years.">More than 10 years.
</ul>
10. Area of employment?
<ul>
<input type = "radio" name = "Area" value = "Financial Aid.">Financial Aid.
<br><input type = "radio" name = "Area" value = "Career Services.">Career Services.
<br><input type = "radio" name = "Area" value = "Stand-alone Student Employment.">Stand-alone Student Employment.
<br><input type = "radio" name = "Area" value = "Human Resources.">Human Resources.
<br><input type = "radio" name = "Area" value = "other.">Other, please indicate:   <input type = "text" width = 50 name = "other_area">
</ul>
11. In which state is your school located? <input type ="text" size = 5 name = "state"><p>
12. Please list other associations of which you are a member:<br><TEXTAREA COLS=70 ROWS=4 NAME="other_associations"></TEXTAREA>
<br><br>
<CENTER>
<INPUT TYPE="submit" VALUE="Submit Survey">
     
<INPUT TYPE="reset" VALUE="Clear Survey"> 
</CENTER><P>
</FORM>
<CENTER><B>Thank you for your time and commitment to student employment.  <br>If you have any questions regarding this survey or MASEA, please feel free to contact me. 
<br>Also, if you're willing to help with the 2003 conference, I'm looking for volunteers!<br><br>
</CENTER>
</BODY>
</HTML>
 

crucial_gear

Registered User.
Local time
Today, 08:33
Joined
Dec 11, 2002
Messages
13
I see that your post is pretty old, however I am wondering if you ever got this work?
Near as I what I can tell you are trying to send an emailed based on the HTML code with the values from your database is this a correct assumption?

I am developing a database now that I have considered including the ability to email data.

This maybe a silly question, but I am wondering how the HTML code is incorporated. I noticed in your recordset you pulled the value HTML from a table but, I did not follow how you are incorporating the html code.

Thanks for your time
 

UniqueTII

What?
Local time
Today, 02:33
Joined
Apr 4, 2002
Messages
96
The HTML is just a page that is stored in its own table. It's supposed to look like a webpage when it's mailed, but ended up looking like some messy text. The rest of the code just loops through the email addresses in their table. I have made a couple of mailing functions, and can help you if you need to send anything other than HTML. :)
 

crucial_gear

Registered User.
Local time
Today, 08:33
Joined
Dec 11, 2002
Messages
13
I have done quite a bit of emails with HTML - I never could get Outlook to send it correctly - it does not seem to understand the MIME format. However I used a product called Group Mail Free from Infacta (www.infacta.com). This product works very well for sending HTML formated emails. Maybe you could get it to work with your Access code.
 

Users who are viewing this thread

Top Bottom