SMTP Send creates *.eml file but does not dispatch email

I am having some difficulty understanding what is happening here:

..... code snippet 

SmtpClient client = new 
SmtpClient(ConfigurationManager.AppSettings["Default_mailClient"]);
client.UseDefaultCredentials = true;
if (!Directory.Exists(LogFolder + @"\" + thisEmail.STATIONID))
    {
       Directory.CreateDirectory(LogFolder + @"\" + thisEmail.STATIONID); 
    }
client.PickupDirectoryLocation = LogFolder + @"\" + thisEmail.STATIONID;
client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;  
MailMessage mailMessage = new MailMessage();
// properties of mailMessage set here e.g From, To, Subject etc
client.Send(mailMessage);

..... after the last statement, I find that an *.eml file is deposited in the 
appropriate folder BUT no email is dispatched.

I am missing something; any help in identifying what that is?

Thanks.
0
Utf
1/27/2010 8:14:01 PM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

2 Replies
1340 Views

Similar Articles

[PageSpeed] 37

On Jan 27, 9:14=A0pm, AA2e72E <AA2e...@discussions.microsoft.com> wrote:
> I am having some difficulty understanding what is happening here:
>
> .... code snippet
>
> SmtpClient client =3D new
> SmtpClient(ConfigurationManager.AppSettings["Default_mailClient"]);
> client.UseDefaultCredentials =3D true;
> if (!Directory.Exists(LogFolder + @"\" + thisEmail.STATIONID))
> =A0 =A0 {
> =A0 =A0 =A0 =A0Directory.CreateDirectory(LogFolder + @"\" + thisEmail.STA=
TIONID);
> =A0 =A0 }
> client.PickupDirectoryLocation =3D LogFolder + @"\" + thisEmail.STATIONID=
;
> client.DeliveryMethod =3D SmtpDeliveryMethod.SpecifiedPickupDirectory; =
=A0
> MailMessage mailMessage =3D new MailMessage();
> // properties of mailMessage set here e.g From, To, Subject etc
> client.Send(mailMessage);
>
> .... after the last statement, I find that an *.eml file is deposited in =
the
> appropriate folder BUT no email is dispatched.
>
> I am missing something; any help in identifying what that is?
>
> Thanks.

SmtpDeliveryMethod.SpecifiedPickupDirectory specifies the directory
where applications save e-mail for later processing by the SMTP
server. So, check if SMTP server is correctly configured.
0
Alexey
1/27/2010 9:40:18 PM
Thanks Alexey.

I need some hints: how do I get to what I am looking for and what am I 
looking for? Are these the properties of the instance of the smtpclient?

"Alexey Smirnov" wrote:

> On Jan 27, 9:14 pm, AA2e72E <AA2e...@discussions.microsoft.com> wrote:
> > I am having some difficulty understanding what is happening here:
> >
> > .... code snippet
> >
> > SmtpClient client = new
> > SmtpClient(ConfigurationManager.AppSettings["Default_mailClient"]);
> > client.UseDefaultCredentials = true;
> > if (!Directory.Exists(LogFolder + @"\" + thisEmail.STATIONID))
> >     {
> >        Directory.CreateDirectory(LogFolder + @"\" + thisEmail.STATIONID);
> >     }
> > client.PickupDirectoryLocation = LogFolder + @"\" + thisEmail.STATIONID;
> > client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;  
> > MailMessage mailMessage = new MailMessage();
> > // properties of mailMessage set here e.g From, To, Subject etc
> > client.Send(mailMessage);
> >
> > .... after the last statement, I find that an *.eml file is deposited in the
> > appropriate folder BUT no email is dispatched.
> >
> > I am missing something; any help in identifying what that is?
> >
> > Thanks.
> 
> SmtpDeliveryMethod.SpecifiedPickupDirectory specifies the directory
> where applications save e-mail for later processing by the SMTP
> server. So, check if SMTP server is correctly configured.
> .
> 
0
Utf
1/28/2010 8:10:01 AM
Reply:

Similar Artilces:

Create a distribution list from addresses in the 'To' list
Hi all, I belong to a social group, and our co-ordinator sends out an email from time to time with all the latest addresses in the To list. I already have a distribution list for the group, which then needs to be checked through and updated. Is there a simple way of transferring those addresses into my own distribution list? I'm using Outlook 2002. Everybody's fiddling around with bits of paper - I'll be a hero if I can make it easy for them! Thanks. Astley http://www.outlook-tips.net/archives/2004/20041105.htm -- Russ Valentine [MVP-Outlook] "Astley" <ast@...

Crash on 'Send"
My wife's Intel Celeron running ME started having this problem sporadically - now constantly. Outlook 2000 receives OK - everything seems fine until you hit the 'Send' button then Outlook crashes giving an error message that says 'Outlook has caused an error in <unknown> and has to shut down. If the problem persists you may have to restart your computer.' Re-starting however has no effect. I have re-installed Office. Used 'Detect & Repair' under the 'Help' tab, and installed all patches/updates from the Office site. But this error continues, now...

Can I send a recurring e-mail automatically each week
I want to send a e-mail with the same verbiage to the same person once a week and make it a recurrence with no end date. Can I set this up once in Outlook so it is scheduled automatically? -- Microsoft Office 2003 Version Students and Teachers Edition Windows Vista Home Premium Thank-you Happy new Year!! Carl R ...

SMTP Connectors #4
Hi, I have a problem with two Front-End servers in NLB. I have two connectors with address space *, one connector with cost 10 the other with cost 20 for connector availability purposes. Inbound mails are targeted to FrontEnd1, outbound mails should go from FrontEnd2 (e.g. MX for FrontEnd1 cost is 10; MX cost for FrontEnd2 is 20) Connectors: FrontEnd1 - Address space * - cost 10 - bridgehead srv = FrontEnd1; FrontEnd2 - Address space * - cost 20 - bridgehead srv = FrontEnd2 The problem: If both servers are up and running and somehow some mail ends in queue on FrontEnd2 it correctly crea...

MS Money 95 data files
I hope that some one can answer this for me. I have used MS Money 95 for years, and it works just fine for me on Windows XP, however, I now have to reformat my hard drive, and have discovered that I can nolonger find my original install disk. Will the latest versions of Money still read the MS Money 95 data files. All that I have ever used the program for is to track my investments, and am unlikely to do any different in the future. Thanks Stan B In microsoft.public.money, Stan Banner wrote: >I hope that some one can answer this for me. >I have used MS Money 95 for years, and...

Recieve Mail Before Sending
How do I set up Outlook 2003 to recieve mail before sending Set your send/receive group settings to receive and not send. Or are you talking about setting authentication? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After searching google.groups.com and finding no answer: Keith <anonymous@discussions.microsoft.com> asked: | How do I set up Outlook 2003 to recieve mail before sending ...

Exchange 2003 new install can not receive external email.
I have just setup a new Windows Server 2003 standard edition with Exchange 2003 standard edition on it. I have been working for a while trying to get it to receive external email. I can send out and send/ receive internal messages, but when someone trys to send me a message from outside our network they get the following returned mail message This Message was undeliverable due to the following reason: Each of the following recipients was rejected by a remote mail server. The reasons given by the server are included to help you determine why each recipient was rejected. Recipient: <**...

cant start outlook pst file to large
Hi I hope somebody may be able to help im new to outlook and now I cant start outlook message says cannot open your default email folders pst file its too large as I cannot open outlook I cannot delete old folders See if this helps: http://support.microsoft.com/kb/296088 -- -Ben- Ben M. Schorr, MVP Roland Schorr & Tower http://www.rolandschorr.com http://www.officeforlawyers.com/outlook.html Author: The Lawyer's Guide to Microsoft Outlook 2007: http://tinyurl.com/ol4law-amazon "Ray" <Ray@discussions.microsoft.com> wrote in message news:B3B824DC-3C9B-4B1B-8EF3-61...

hyperlinking email addresses
I have a list of email addresses that have hidden text before the first letter of the email address. I tried all the functionalities to get rid of this spacing/hidden text, but, it does not work. Now I am trying to hyperlink the email addresses, how do I do that? Most likely a non-breaking space...........char 160 CLEAN and TRIM will not pick it up. Try Edit>Replace What: Alt + 0160(on numpad) With: nothing Replace all. Gord Dibben MS Excel MVP On Sat, 9 Jan 2010 13:44:01 -0800, CharlesZ <CharlesZ@discussions.microsoft.com> wrote: >I have a ...

How do I create several NEW templates from start to finish please?
Hi knowledgeable people. I am looking for instructions on how to create a range of basic templates that I can use, perhaps even by selecting them as 'stationery', for example; if I go to >New >Format >Apply stationery, or any other similar method. I can create new html stationery backgrounds, but this is NOT what I am looking for, as a lot of people still read email in plain text only...does this make sense? Plain text templates would be fine. I simply can't find any info on creating email templates anywhere to suit this Windows Live Mail Desktop versio...

Outlook 2003
Hello, we have one client pc with Outlook 2003 where the following problem occurs: if a mail is replied from a user created sub folder of the inbox, the reply will not appear in sent mails, but will end up in the same sub folder, sender and recipient appear as identical. The mail goes out properly though, it's just that Outlook sets internally sender = recipient and bounces the reply back to the subfolder in which the original mail is stored. This happens on a Win 2000 machine with SP4 and all updates, the other clients use Outlook 2000 or XP and there is no such problem. There are no ru...

Where is the workspace file stored?
I was given a project folder containing several dozen files. So where is the workspace file normally located? If I don't have a workspace file how can I cerate one? Using VC version 6. TIA I haven't used VC6 for some time, but if I remember right you can just open the .dsp file and it will create a .dsw file for you. It typically goes in the same folder with the code. Tom "Phisherman" <noone@nobody.com> wrote in message news:be93539ccf8a6f25ibh4vt6ggmtbi024mq@4ax.com... >I was given a project folder containing several dozen files. So where > is the wor...

Change File Locations to Private Drive (not Folder)
Hi, I know that I can use "File Locations" in "Options" so that whenever I use the "Open..." command in Word, it will open to a specific folder. I'm wondering if there is a way that this can be applied not to a folder but to a specific drive on a network. Our company has a main public drive and has also assigned each of the Staff their own private drive. Is there a way to access the "main page" (for lack of a better term) of my private drive each time I use "Open..." in Word? Right now it goes to "My Computer" or ...

Unexpected error message on closing an Excel file
Suddenly I am getting the following message when I try to close a workbook: "Your formula contains an invalid external reference to a worksheet. Verify that the path, workbook, and range name or cell reference are correct, and try again" The mysterious thing is that it does not happen consistently and that, after I click OK after the above message, I can still save the file. What might be the cause of this error message and can the "invalid reference" be tracked down using one of the utility add-ins such as J. Walkenbach's PUP? If it only happens when you close ...

Drag and Drop file/directory names on Tree Control.
hi, I am writing an application in which i have one Tree control. Now i want that , when user drag & drop any file/folder on tree control the file name/folder name should be add in the tree control item. User may drag and drop file from desktop or may be from directory. I just want the path of that file/foder name nothing else. so plz tell me will it be possible ... Plz Help me............. Klic..... > I am writing an application in which i have one Tree control. >Now i want that , when user drag & drop any file/folder on tree >control the file nam...

adding name /creating field/query?
Hello, I can create an invoice_number field in a query using the primary field ID from the main table as invoice_number: ID but if ID say is 100, I cannot work out how to create renewal_invoice_100 Cheers Geoff Geoff We aren't there. We can't see what you're looking at. Where did "renewal_invoice_100" come from and what does it mean? Please post the SQL statement of the query you are trying to use. -- Regards Jeff Boyce www.InformationFutures.net Microsoft Office/Access MVP http://mvp.support.microsoft.com/ Microsoft IT Academy Program Mentor http://micro...

Creating new attributes
When using Schema Manager to create new attributes, I'm not able to create a new attribute with "Lookup" as type, "Lookup" is not availabe as one of the type options. But yet some of the exist fields, for example, in Account table came with "Lookup" as type. Why? Is there a work-around? Please help. Thanks. You cannot add custom lookup's to the current release of MSCRM. The only way around is to build a custom .aspx page and build your own. Might be possible in the next release. "HEC" wrote: > When using Schema Manager to crea...

opening .bak file
Hi, I hope someone can help! I recently was performing a compacting operation on my outlook express folders. My computer shutdown due to a power failure and I lost some emails from a few of my folders. I was however able to get the .bak files (of the .dbx files that were lost) out of the recycle bin. If I could open one of these .bak files or convert it back to the .dbx file from which it was created I would retrieve these emails. Can anyone instruct me as to open this .bak file? Thanks for any help! Arnie K. How did you get the bak files out of the Recycle Bin? All e...

Email Router Failing with System.UriFormatException: Invalid URI:
I cannot seem to get a handle on this, even with a very basic email workflow rule. The rule is simply to watch test@mydomain.com. If any email goes in, send a notification email to user@mydomain.com The Server has the following error. Anyone have any ideas? Event Type: Error Event Source: MSCRMExRouterService Event Category: None Event ID: 0 Date: 1/21/2007 Time: 4:01:50 PM User: N/A Computer: IAHSR0002 Description: System.UriFormatException: Invalid URI: The hostname could not be parsed. at System.Uri.Parse() at System.Uri..ctor(String uriString, Boolean dontEscape) at Sy...

Incoming email slow to come in
Don't know if anyone can help, but here goes. We are running an Exchange 5.5 server and I am running Outlook 2003. Email that is sent to me internally is very slow to arrive (up to 30-45 seconds), including email I send to myself. Nobody else in my immediate vicinity is having the same issue, their email arrival is instant. We have reviewed Outlook settings and they are identical. One strange thing is this: If I send myself an email, don't do anything, it will come in within 30-45 seconds. However, if I send myself an email, then immediately send another email both of them will ...

Trying to read XML file into dataset
Hello. Developing a web site in VS2005, SP1, VB, .NET 2.0, ASP.NET 2.0 on XP Pro, SP2. I eventually want to use a gridview table to view xml data, but right now i can't seem to get my xml data into a dataset so that i can use it. I have an XML file and can open it in IE. There is no XSD or XSL file to go with it. I can't seem to get the XML data into a dataset. I tried using the following code, but it just does nothing. It doesn't give an error. It just executes the code and does nothing. Dim dataSet As DataSet = New DataSet dataSet.ReadXml("...

Reverse created rules
I inadvertantly created a rule to automatically send emails from an email address directly into the deleted files. How do I reverse or delete the rule for this sender??????? If this is Outlook then select the Tools Menu > Rules Wizard > locate the Rule and delete it, if its Outlook Express then go to Tools > Message Rules "joebzii@everestkc.net" <anonymous@discussions.microsoft.com> wrote in message news:1c12401c4218b$fa8e7f70$a401280a@phx.gbl... > I inadvertantly created a rule to automatically send > emails from an email address directly into the deleted &...

Outlook freezes after sending one email after upgrading 4.0
We just upgraded from 3.0 to 4.0 this weekend. All client machines have had the desktop client upgraded and 2 have the same issue. One is XP with Outlook 2003 and the other is Vista with Outlook 2007. Open opens and the CRM addin initializes correctly. As soon as you compose and send an email, Outlook locks up and you have to kill the process in task manager to close Outlook. I've had the same problem and have tried all I can think of...how did you fix this issue? Thank you. "Sander" wrote: > We just upgraded from 3.0 to 4.0 this weekend. All client machines have...

Outlook 2007 create background
it seems that there is no way to create a stationary or theme in outlook 2007 !? Aloha ami, I wish that were true however...Tools | Options | Mail Format | Stationery and Fonts. -Ben- Ben M. Schorr - MVP Roland Schorr & Tower http://www.rolandschorr.com Microsoft OneNote FAQ: http://www.factplace.com/onenotefaq.htm > it seems that there is no way to create a stationary or theme in > outlook 2007 !? > You cannot create new stationery for Outlook 2007, but you can create = new themes. In an open message, on the Options tab, make your changes = with the commands in the Them...

Is there a way to schedule a email to send out at a certain time?
I tried delay the mail, but the sent hour is not right. For example, the email should go out at 8am, but the sent time is 5:30pm which should be 8am also. Please help! "Grace" <Grace@discussions.microsoft.com> wrote in message news:1395D87B-2982-4800-8522-165781125E6A@microsoft.com... >I tried delay the mail, but the sent hour is not right. > For example, the email should go out at 8am, but the sent time is 5:30pm > which should be 8am also. Please help! The Sent time and the delivery time are completely separate. The Sent time that people will see w...