|
Hi
How to Track the delivery Status of email.i am sending emails from System.Net.Mail in C#.NET.i want know weather email sent or Bounced or any error While Sending email.I code it in Try Catch block,if no error i am assuming that mail was deliverd else disply error message from Catch Block.
Thanks for any help.
TRK
|
|
|
|
|
TRK@UK wrote: if no error i am assuming that mail was deliverd
Not really. That just means your client application was able to successfully request the SMTP server to deliver the message.
/ravi
|
|
|
|
|
You can not get any delivery status for a mail when you send it, as it is not delivered directly to the recipient. You only know if it got delivered to your outgoing mail server.
You can never ever be certain if a mail was delivered or not. The closest you can get is if you include a request for a receipt in the mail, then the receiving mail program may attempt to send a receipt back to you when the user opens it.
If the mail could not be delivered, the mail server may attempt to send an error report to the mail address that you supplied as sender. In some cases, for example if the mail was filtered out as spam, it will not send any error report.
---
Year happy = new Year(2007);
|
|
|
|
|
Guffa wrote: You can never ever be certain if a mail was delivered or not. The closest you can get is if you include a request for a receipt in the mail, then the receiving mail program may attempt to send a receipt back to you when the user opens it.
Actually you can get a bit closer than that if you're sending html email, the recipient's client displays images, and you have a webserver. Embed a link to an image on your webserver with a unique identifier in the URL, if the image is ever accessed the email was displayed.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
dan neely wrote: Actually you can get a bit closer than that if you're sending html email, the recipient's client displays images, and you have a webserver. Embed a link to an image on your webserver with a unique identifier in the URL, if the image is ever accessed the email was displayed.
That is an alternative, but I'm not certain that it is any closer. The recipient may choose not to display images in mails, just as s/he can choose not to send any receipt.
---
Year happy = new Year(2007);
|
|
|
|
|
Greetings all. I'm writing a performance test harness for a system that uses the System.Collections.Generics.Dictionary to contain some rather large collections of things, and I'd like to pick a random entry from these dictionaries and do something with it. The key and values cannot be easily produced randomly, so my best bet is to randomize an int between 0 and dict.Count, and then pull the entry. Obviously this would work fine with a Hashtable, since it has an integer indexer.
But I can't find any way to kludge an int indexer into a Dictionary that isn't a performance pig (which kind of distorts my performance test results). For example, my current (Uggh) code does this:
dictKeyType[] dictKeys = new dictKeyType[dict.Count];<br />
dict.Keys.CopyTo(dictKeys, 0);<br />
<br />
int idx = GetRandomInt(dictKeys.Length - 1);<br />
dictKeyType randomKey = dictKeys[idx];<br />
but obviously for large amounts of data, the array copy is going to distort both time and memory use. The distortion in memory use can be avoided by doing a foreach loop through the keys while decrementing the randomInt and then taking the value when you hit zero... but man, wouldn't it be better to just have an int indexer on the Dictionary (or Keys)?
Anyone have an idea on this? Or have I just missed something immensely simple?
Mike
---------------------
www.opusedge.com
|
|
|
|
|
Can you use Dictionary.KeyCollection.Count ?
/ravi
|
|
|
|
|
I use the count to do the upper bound on the random number, but I can't use it to index into the Dictionary.
Mike
---------------------
www.opusedge.com
|
|
|
|
|
Sorry, I misunderstood. I see your quandary.
/ravi
|
|
|
|
|
Hi,
you could:
1. collect all (or a significant range of) key values in a new collection (e.g. ArrayList)
2. randomly pick one out there and search your dictionary for it.
Even when the dictionary evolves, there is probably no need to repeat step 1
all the time in order to perform performance tests...
(
Luc Pattyn
|
|
|
|
|
I have been considering something slightly different, but along these lines, which is to build a schedule of actions and store them in a list, and then run through the list of stored actions.
Sure would be nice to have the equivalent of an array subscript into the dictionary or key colleciton, tho.
Mike
---------------------
www.opusedge.com
|
|
|
|
|
OK this is I need to do.
1. How to insert picture in RTB ?
2. How to print in WSISYG manner RTB?
I know regular way of printing is to open StringBuilder&StringWriter, etc. Which work fine for flat text.
But overall I believe I need to specify one printFont at end of this method and that is all... not what I want.
What if I want to print document with pictures and lot's of different fonts (multipage...). Is there some better way to do this?
Thanks!!!
|
|
|
|
|
Any idea please... I searched MSDN but only solution is throught win32 api or something, anyhing .net only?
|
|
|
|
|
OK I did it using this method
http://support.microsoft.com/kb/146022
can someone explain to me bit simplified what they actually did there?
|
|
|
|
|
I would like to set up my .NET C# application so that I can connect to it from another C# application and access various properties and methods.
I could probably achieve this with "Register for COM Interop", but it seems as though there should be a much simpler way using purely managed code.
I suspect (& hope) this is probably really easy and that I'm just missing something simple, but I can't seem to figure it out or find any references to this online.
|
|
|
|
|
Have you looked at .NET Remoting?
only two letters away from being an asset
|
|
|
|
|
Hi all,
I have using FileSystemWatcher class so as to watch particular folder. If any new files get copied to it, windows explorer open the folder automatically. It works fine with console application but when it's been created as a windows service, it doesn't work. The code ---
public class JobClass
{
public void startJob()
{
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Filter = "*.*";
watcher.Path = "c:\\DMSTemp";
watcher.EnableRaisingEvents = true;
watcher.Created +=new FileSystemEventHandler(watcher_Created);
Console.ReadLine();
}
void watcher_Created(object sender, FileSystemEventArgs e)
{
Process process = new Process();
process.StartInfo.FileName = "explorer.exe";
process.StartInfo.CreateNoWindow = true;
process.StartInfo.Arguments = "c:\\DMSTemp";
process.Start();
}
}
From the onStart() event of WindowsService, JobClass's startJob method is invoked.
protected override void OnStart(string[] args)
{
JobClass jobClass = new JobClass();
jobClass.startJob();
}
Any idea?
Thanks,
milan
satan
|
|
|
|
|
I have an MDI form. A child form (frm1) can be launched from the MDI's menu. A contol on the child form launches another form (frm2) whos parent is the MDI form.
When I launch frm1, it is launched as Maximized. When I launch frm2 from frm1 I launch it as windowstate Normal. However, it doesn't launch as normal. It launches as maximized. How can I fix this?
|
|
|
|
|
This seems to be expected behavior, much like opening a new document in Visual Studio when existing documents are displayed as maximized.
/ravi
|
|
|
|
|
Hi all
I'm new to C# and .Net 2.0 multithreading system.
I read about Thread.BeginCriticalRegion() and Thread.EndCriticalRegion() function to ensure that when the user call Abort() for a thread, this executes until the end of the critical region before it exits.
What I would like to know is what happens if the CriticalRegion is inserted in a try/catch block with the handling of a ThreadAbortException ?
Does it behaves the same( it executes until Thread.EndCriticalRegion() )? or does the exception is thrown immmediately even in the middle of the CriticalRegion area?
Reagards
ManuStone
|
|
|
|
|
The behavior seems to be dependent on the CLR host. According to MSDN[^], some hosts may decide to unload the entire app domain rather than take the risk of continuing execution in a potentially unstable state. If the app domain isn't unloaded, it appears that the code will execute until EndCriticalRegion() is called, afer which control will transfer to the catch() handler.
/ravi
|
|
|
|
|
Hi Ravi
thank you for your response.
Regards
manStone
|
|
|
|
|
Is it possible to use foreach with enums?
basically this is what I want to do:
public enum Color
{
red,
blue,
green
}
public class ColorStar
{
public ColorStar(Color c);
public static List<Color> MakeAllColors()
{
List<Color> colors = new List<Color>();
foreach (Color c in Color)
colors.Add(new ColorStar(c);
return colors
}
}
I know about Enum.GetNames and Enum.GetValues, but I don't want the names or values I want the actual enum items.
|
|
|
|
|
I think this should do what you want:
foreach (Color c in [Enum].GetValues(GetType(Colors))) {
...;
}
/ravi
|
|
|
|
|
Yeah, that did it... evidently I completely misread some documentation the first time I looked at it.
Thank you!
|
|
|
|