Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: x-mailer multiple times

$
0
0
Re: x-mailer multiple times
Web Connection 5.0
Re: x-mailer multiple times
Feb. 26, 2013
02:39 pm
3Q40VFIP0Show this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Matthew J. Olson
Hi Matthew,

Couple of things.

If you use the .NET mailer, this won't happen.

If you use the classic mailer you have to clear the headers (cExtraHeaders) between each mail run. With the classic mailer I'd recommend that you just re-create the wwSmtp object for each mail iteration.

There's no clean way to remove the headers between each mail run as you might want to look at the headers after mailing. Unfortunately the old component has a single store for the headers and some of the internal properties are added to these extra headers. The .NET component doesn't use extra headers to set default values, so it has s completely separate property storage scheme that avoids this whole problem. The old component was designed for one off emails - hence recreation is the best way to ensure you get exactly what you expect for classic mode.

FWIW, if you're sending stuff in bulk (ie. many emails) the .NET mailer will be much more efficient because it actually can keep a connection to the server open, while the classic component has to reconnect every time you send an email.

+++ Rick ---



I think I figured out the issue using this Papercut program. If I send a single email, I see only one x-mailer line. But if I send multiple emails it will put multiple x-mailer lines, one for each email sent. So the first email will have one x-mailer, the second two x-mailers, the third three x-mailers, and so on.

So, in looking at my code, I set up the wwsmtp object just once. Then I set the items that don't change (like sender email, mail server, etc.). Then I enter my loop that sets up the items that change (recipient and message body) and sends the email.

So, please excuse my ignorance here, but it looks like I am doing this wrong. Though it would be awesome if my issue is just I also need to reset the header or something trivial like that. Let me know your thoughts.

Thanks,
Matthew

I don't see that. While it could potentially be in there twice (there's a bug in the classic SMTP component that will add the header twice if you explicitly add it), certainly that many times has to be coming from something else (possibly the email client screwing up...

To check what the client is actually sending you can download Papercut, which is a local Email server that simply captures the raw SMTP message sent by the client.

http://papercut.codeplex.com/

This will show you exactly what wwSmtp is sending...

In my tests I only see the x-mailer header once in both the .NET and classic component.

+++ Rick ---


I'm still stuck on this issue. Anyone have any suggestions? Here is an example of what I am seeing in the header:

x-mailer:West Wind SMTP 5.0
x-mailer:West Wind SMTP 5.0
x-mailer:West Wind SMTP 5.0
x-mailer:West Wind SMTP 5.0
x-mailer:West Wind SMTP 5.0
x-mailer:West Wind SMTP 5.0
x-mailer:West Wind SMTP 5.0
x-mailer:West Wind SMTP 5. èH²
To: xxxx@yyyyy.com

(Note: I've removed a few dozen of the x-mailer lines for brevity.)

Again, I appreciate any ideas anyone may have on this.

Thanks,
Matthew


Running wwipstuff (and sometime wwdotnetbridge if I need SSL) to send emails. It was brought to my attention that the x-mailer line was showing multiple times in the header. My email client hides the header by default, but not everyone's does. Plus, I am starting to hear about some latency issues here of late. I wouldn't think this would hurt performance, but I am sure it doesn't help either. Anyway, the line says:
x-mailer:West Wind SMTP 5.0

If anyone has any ideas on having it only show once, I would greatly appreciate the assistance.

Thanks,
Matthew







Rick Strahl
West Wind Technologies


from Maui, Hawaii

Making waves on the Web

HTML Help Builder

Viewing all articles
Browse latest Browse all 10393

Trending Articles