About

I'm Mike Pope. I live in the Seattle area. I've been a technical writer and editor for over 30 years. I'm interested in software, language, music, movies, books, motorcycles, travel, and ... well, lots of stuff.

Read more ...

Blog Search


(Supports AND)

Google Ads

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

It has been remarked that Mr. Pecksniff was a moral man. So he was. Perhaps there never was a more moral man than Mr. Pecksniff: especially in his conversation and correspondence. Some people likened him to a direction-post, which is always telling the way to a place, and never goes there.

— Charles Dickens



Navigation





<July 2014>
SMTWTFS
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

Categories

  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  

Contact

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 7/23/2014

Totals
Posts - 2304
Comments - 2489
Hits - 1,648,177

Averages
Entries/day - 0.57
Comments/entry - 1.08
Hits/day - 407

Updated every 30 minutes. Last: 1:56 AM Pacific


  01:00 AM

A little preview: at work today, someone noted to me that in .NET 1.1, they added support for CDO fields to my good friend the System.Web.Mail class. The theory is that this will allow us to set/pass values that are not directly exposed via properties on the MailMessage class. The canonical example goes like this:
MailMessage m = new MailMessage(); 
m.From = "..."; // fill in appropriately
m.To = "..."; // fill in appropriately
m.Subject = "Subject";
m.Body= "test " + DateTime.Now.ToString();
m.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
m.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = user;
m.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = password;
SmtpMail.Send(m);
And in fact, mharder had a a post about this on the forums a while back. (Who knew? Not me.)

The example illustrates the solution to a popular question: how to pass authentication credentials with an email message if the server requires logon. I got this working tonight on my local SMTP server. The smtpauthenticate field is set to 1 in the example, which per the CdoProtocolsAuthentication enum indicates Basic. So I set my SMTP server to require Basic auth, turned off anonymous access, and gave it a try. Worked!

According to the docs, you're supposed to be able to set other fields as well. The other one that really interests me is setting the Reply-To field, another question I've been asked. Alas, no luck. I'm trying this:
m.Fields("http://schemas.microsoft.com/cdo/configuration/senduserreplyemailaddress") _
= "Mike Pope <mikepope@myotherdomain.com>"
(In VB, of course.) The field and value are accepted (changing the field name to "foo" throws), and the email gets sent. However, when I grub around in the message details, there's no reply-to info anywhere. So I don't know what CDO is doing with this value that I'm setting.

Well, perhaps that will solve itself.


Update, 1:36am Well, shoot -- thanks to Colt (see comment), we also now have Reply-To figured out. Basically, we now know that the Headers property, which is a simple dictionary, will take any header value (that is, anything documented here). By golly, I've learned two things today, and it's barely past midnight.

[categories]   ,

[9] |