|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Emails getting stuck in OutboxI am sending a number of emails (around 600) using the vb.net code below. The problem is that the emails end up in the OL2007 Outbox with a clock icon and do not go out. If I open one of the email items and click Send then that item goes out but this technique is too cumbersome for 600 or so emails. What is the problem and how can I fix it? Many Thanks Regards Dim objOutlook As Object = CreateObject("Outlook.Application") Dim NS As Object = objOutlook.GetNamespace("MAPI") Dim objOutlookMsg As Object Dim BodyText As String Dim fso, ts fso = CreateObject("Scripting.FileSystemObject") ts = fso.OpenTextFile(Me.txtHtml.Text.ToString, 1) BodyText = ts.ReadAll NS.Logon() While .... ' Create the message. objOutlookMsg = objOutlook.CreateItem(0) objOutlookMsg.To = "some address" objOutlookMsg.Subject = "some subject" objOutlookMsg.HTMLBody = BodyText objOutlookMsg.send() objOutlookMsg = Nothing System.Windows.Forms.Application.DoEvents() End While NS.Logoff() NS = Nothing objOutlook = Nothing I never used this MAPI object, but off the top of my head it sounds
like its not design to start the sending processing until you explicitly tell its so. It would be kind of a waste to being sending as you create each one. Queuing it first might allow it to consolidate the messsges going to one particular host and do that with one SMTP send call vs X amount. So look for a method or idea that basically says: NS.Send_the_stuff_I_Just_created() object method or something you do after the loop and before you close, or maybe a mail property per object that says "SendNow()" Its what I would for if confronted with this. -- Show quoteHide quoteJohn wrote: > Hi > > I am sending a number of emails (around 600) using the vb.net code below. > The problem is that the emails end up in the OL2007 Outbox with a clock icon > and do not go out. If I open one of the email items and click Send then that > item goes out but this technique is too cumbersome for 600 or so emails. > What is the problem and how can I fix it? > > Many Thanks > > Regards > > > > Dim objOutlook As Object = CreateObject("Outlook.Application") > Dim NS As Object = objOutlook.GetNamespace("MAPI") > Dim objOutlookMsg As Object > Dim BodyText As String > Dim fso, ts > > fso = CreateObject("Scripting.FileSystemObject") > ts = fso.OpenTextFile(Me.txtHtml.Text.ToString, 1) > BodyText = ts.ReadAll > > NS.Logon() > > While .... > ' Create the message. > objOutlookMsg = objOutlook.CreateItem(0) > objOutlookMsg.To = "some address" > objOutlookMsg.Subject = "some subject" > objOutlookMsg.HTMLBody = BodyText > > objOutlookMsg.send() > > objOutlookMsg = Nothing > System.Windows.Forms.Application.DoEvents() > End While > > NS.Logoff() > NS = Nothing > > objOutlook = Nothing > > > John
Since ISP's put limits on how many you can send out a single ,daily,weekly , I suggest you call your ISP for the limits that is imposed on your Outlook client with your ISP -- Show quoteHide quotePeter Please Reply to Newsgroup for the benefit of others Requests for assistance by email can not and will not be acknowledged. "John" <info@nospam.infovis.co.uk> wrote in message news:eNJyVK94JHA.1372@TK2MSFTNGP05.phx.gbl... > Hi > > I am sending a number of emails (around 600) using the vb.net code below. The > problem is that the emails end up in the OL2007 Outbox with a clock icon and do > not go out. If I open one of the email items and click Send then that item goes > out but this technique is too cumbersome for 600 or so emails. What is the problem > and how can I fix it? > > Many Thanks > > Regards > > > > Dim objOutlook As Object = CreateObject("Outlook.Application") > Dim NS As Object = objOutlook.GetNamespace("MAPI") > Dim objOutlookMsg As Object > Dim BodyText As String > Dim fso, ts > > fso = CreateObject("Scripting.FileSystemObject") > ts = fso.OpenTextFile(Me.txtHtml.Text.ToString, 1) > BodyText = ts.ReadAll > > NS.Logon() > > While .... > ' Create the message. > objOutlookMsg = objOutlook.CreateItem(0) > objOutlookMsg.To = "some address" > objOutlookMsg.Subject = "some subject" > objOutlookMsg.HTMLBody = BodyText > > objOutlookMsg.send() > > objOutlookMsg = Nothing > System.Windows.Forms.Application.DoEvents() > End While > > NS.Logoff() > NS = Nothing > > objOutlook = Nothing > > > John,
Any reason why you want to use Mapi as SMTP is probably then as well possible? Cor Show quoteHide quote "John" <info@nospam.infovis.co.uk> wrote in message news:eNJyVK94JHA.1372@TK2MSFTNGP05.phx.gbl... > Hi > > I am sending a number of emails (around 600) using the vb.net code below. > The problem is that the emails end up in the OL2007 Outbox with a clock > icon and do not go out. If I open one of the email items and click Send > then that item goes out but this technique is too cumbersome for 600 or so > emails. What is the problem and how can I fix it? > > Many Thanks > > Regards > > > > Dim objOutlook As Object = CreateObject("Outlook.Application") > Dim NS As Object = objOutlook.GetNamespace("MAPI") > Dim objOutlookMsg As Object > Dim BodyText As String > Dim fso, ts > > fso = CreateObject("Scripting.FileSystemObject") > ts = fso.OpenTextFile(Me.txtHtml.Text.ToString, 1) > BodyText = ts.ReadAll > > NS.Logon() > > While .... > ' Create the message. > objOutlookMsg = objOutlook.CreateItem(0) > objOutlookMsg.To = "some address" > objOutlookMsg.Subject = "some subject" > objOutlookMsg.HTMLBody = BodyText > > objOutlookMsg.send() > > objOutlookMsg = Nothing > System.Windows.Forms.Application.DoEvents() > End While > > NS.Logoff() > NS = Nothing > > objOutlook = Nothing > > > Keeps record of emails sent in Outlook.
Thanks Regards Show quoteHide quote "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message news:%23c59WdB5JHA.3544@TK2MSFTNGP04.phx.gbl... > John, > > Any reason why you want to use Mapi as SMTP is probably then as well > possible? > > Cor > > "John" <info@nospam.infovis.co.uk> wrote in message > news:eNJyVK94JHA.1372@TK2MSFTNGP05.phx.gbl... >> Hi >> >> I am sending a number of emails (around 600) using the vb.net code below. >> The problem is that the emails end up in the OL2007 Outbox with a clock >> icon and do not go out. If I open one of the email items and click Send >> then that item goes out but this technique is too cumbersome for 600 or >> so emails. What is the problem and how can I fix it? >> >> Many Thanks >> >> Regards >> >> >> >> Dim objOutlook As Object = CreateObject("Outlook.Application") >> Dim NS As Object = objOutlook.GetNamespace("MAPI") >> Dim objOutlookMsg As Object >> Dim BodyText As String >> Dim fso, ts >> >> fso = CreateObject("Scripting.FileSystemObject") >> ts = fso.OpenTextFile(Me.txtHtml.Text.ToString, 1) >> BodyText = ts.ReadAll >> >> NS.Logon() >> >> While .... >> ' Create the message. >> objOutlookMsg = objOutlook.CreateItem(0) >> objOutlookMsg.To = "some address" >> objOutlookMsg.Subject = "some subject" >> objOutlookMsg.HTMLBody = BodyText >> >> objOutlookMsg.send() >> >> objOutlookMsg = Nothing >> System.Windows.Forms.Application.DoEvents() >> End While >> >> NS.Logoff() >> NS = Nothing >> >> objOutlook = Nothing >> >> >> > With an Exchange Server or simply as a standalone?
Show quoteHide quote "John" <info@nospam.infovis.co.uk> wrote in message news:u26fgmB5JHA.3476@TK2MSFTNGP05.phx.gbl... > Keeps record of emails sent in Outlook. > > Thanks > > Regards > > "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message > news:%23c59WdB5JHA.3544@TK2MSFTNGP04.phx.gbl... >> John, >> >> Any reason why you want to use Mapi as SMTP is probably then as well >> possible? >> >> Cor >> >> "John" <info@nospam.infovis.co.uk> wrote in message >> news:eNJyVK94JHA.1372@TK2MSFTNGP05.phx.gbl... >>> Hi >>> >>> I am sending a number of emails (around 600) using the vb.net code >>> below. The problem is that the emails end up in the OL2007 Outbox with a >>> clock icon and do not go out. If I open one of the email items and click >>> Send then that item goes out but this technique is too cumbersome for >>> 600 or so emails. What is the problem and how can I fix it? >>> >>> Many Thanks >>> >>> Regards >>> >>> >>> >>> Dim objOutlook As Object = CreateObject("Outlook.Application") >>> Dim NS As Object = objOutlook.GetNamespace("MAPI") >>> Dim objOutlookMsg As Object >>> Dim BodyText As String >>> Dim fso, ts >>> >>> fso = CreateObject("Scripting.FileSystemObject") >>> ts = fso.OpenTextFile(Me.txtHtml.Text.ToString, 1) >>> BodyText = ts.ReadAll >>> >>> NS.Logon() >>> >>> While .... >>> ' Create the message. >>> objOutlookMsg = objOutlook.CreateItem(0) >>> objOutlookMsg.To = "some address" >>> objOutlookMsg.Subject = "some subject" >>> objOutlookMsg.HTMLBody = BodyText >>> >>> objOutlookMsg.send() >>> >>> objOutlookMsg = Nothing >>> System.Windows.Forms.Application.DoEvents() >>> End While >>> >>> NS.Logoff() >>> NS = Nothing >>> >>> objOutlook = Nothing >>> >>> >>> >> > > Both. We use one or the other depending on if it is to be sent from main
domain handled by exchange or auxiliary domains handled by outlook standalone. Regards Show quoteHide quote "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message news:ez0CH1B5JHA.2656@TK2MSFTNGP05.phx.gbl... > With an Exchange Server or simply as a standalone? > > "John" <info@nospam.infovis.co.uk> wrote in message > news:u26fgmB5JHA.3476@TK2MSFTNGP05.phx.gbl... >> Keeps record of emails sent in Outlook. >> >> Thanks >> >> Regards >> >> "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message >> news:%23c59WdB5JHA.3544@TK2MSFTNGP04.phx.gbl... >>> John, >>> >>> Any reason why you want to use Mapi as SMTP is probably then as well >>> possible? >>> >>> Cor >>> >>> "John" <info@nospam.infovis.co.uk> wrote in message >>> news:eNJyVK94JHA.1372@TK2MSFTNGP05.phx.gbl... >>>> Hi >>>> >>>> I am sending a number of emails (around 600) using the vb.net code >>>> below. The problem is that the emails end up in the OL2007 Outbox with >>>> a clock icon and do not go out. If I open one of the email items and >>>> click Send then that item goes out but this technique is too cumbersome >>>> for 600 or so emails. What is the problem and how can I fix it? >>>> >>>> Many Thanks >>>> >>>> Regards >>>> >>>> >>>> >>>> Dim objOutlook As Object = CreateObject("Outlook.Application") >>>> Dim NS As Object = objOutlook.GetNamespace("MAPI") >>>> Dim objOutlookMsg As Object >>>> Dim BodyText As String >>>> Dim fso, ts >>>> >>>> fso = CreateObject("Scripting.FileSystemObject") >>>> ts = fso.OpenTextFile(Me.txtHtml.Text.ToString, 1) >>>> BodyText = ts.ReadAll >>>> >>>> NS.Logon() >>>> >>>> While .... >>>> ' Create the message. >>>> objOutlookMsg = objOutlook.CreateItem(0) >>>> objOutlookMsg.To = "some address" >>>> objOutlookMsg.Subject = "some subject" >>>> objOutlookMsg.HTMLBody = BodyText >>>> >>>> objOutlookMsg.send() >>>> >>>> objOutlookMsg = Nothing >>>> System.Windows.Forms.Application.DoEvents() >>>> End While >>>> >>>> NS.Logoff() >>>> NS = Nothing >>>> >>>> objOutlook = Nothing >>>> >>>> >>>> >>> >> >> > John,
I have to go, Can you search on MSDN for Exchange Server and SMTP Exchange has a special feature for this. Cor Show quoteHide quote "John" <info@nospam.infovis.co.uk> wrote in message news:%235$x12B5JHA.4492@TK2MSFTNGP02.phx.gbl... > Both. We use one or the other depending on if it is to be sent from main > domain handled by exchange or auxiliary domains handled by outlook > standalone. > > Regards > > "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message > news:ez0CH1B5JHA.2656@TK2MSFTNGP05.phx.gbl... >> With an Exchange Server or simply as a standalone? >> >> "John" <info@nospam.infovis.co.uk> wrote in message >> news:u26fgmB5JHA.3476@TK2MSFTNGP05.phx.gbl... >>> Keeps record of emails sent in Outlook. >>> >>> Thanks >>> >>> Regards >>> >>> "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message >>> news:%23c59WdB5JHA.3544@TK2MSFTNGP04.phx.gbl... >>>> John, >>>> >>>> Any reason why you want to use Mapi as SMTP is probably then as well >>>> possible? >>>> >>>> Cor >>>> >>>> "John" <info@nospam.infovis.co.uk> wrote in message >>>> news:eNJyVK94JHA.1372@TK2MSFTNGP05.phx.gbl... >>>>> Hi >>>>> >>>>> I am sending a number of emails (around 600) using the vb.net code >>>>> below. The problem is that the emails end up in the OL2007 Outbox with >>>>> a clock icon and do not go out. If I open one of the email items and >>>>> click Send then that item goes out but this technique is too >>>>> cumbersome for 600 or so emails. What is the problem and how can I fix >>>>> it? >>>>> >>>>> Many Thanks >>>>> >>>>> Regards >>>>> >>>>> >>>>> >>>>> Dim objOutlook As Object = CreateObject("Outlook.Application") >>>>> Dim NS As Object = objOutlook.GetNamespace("MAPI") >>>>> Dim objOutlookMsg As Object >>>>> Dim BodyText As String >>>>> Dim fso, ts >>>>> >>>>> fso = CreateObject("Scripting.FileSystemObject") >>>>> ts = fso.OpenTextFile(Me.txtHtml.Text.ToString, 1) >>>>> BodyText = ts.ReadAll >>>>> >>>>> NS.Logon() >>>>> >>>>> While .... >>>>> ' Create the message. >>>>> objOutlookMsg = objOutlook.CreateItem(0) >>>>> objOutlookMsg.To = "some address" >>>>> objOutlookMsg.Subject = "some subject" >>>>> objOutlookMsg.HTMLBody = BodyText >>>>> >>>>> objOutlookMsg.send() >>>>> >>>>> objOutlookMsg = Nothing >>>>> System.Windows.Forms.Application.DoEvents() >>>>> End While >>>>> >>>>> NS.Logoff() >>>>> NS = Nothing >>>>> >>>>> objOutlook = Nothing >>>>> >>>>> >>>>> >>>> >>> >>> >> > > You should be posting this to the outlook.program_vba group - the outlook
developers don't usually visit the general groups. -- Show quoteHide quoteDiane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Outlook Tips by email: mailto:dailytips-subscribe-requ***@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWSLETTER-SUBSCRIBE-REQU***@PEACH.EASE.LSOFT.COM You can access this newsgroup by visiting http://www.microsoft.com/office/community/en-us/default.mspx or point your newsreader to msnews.microsoft.com. "John" <info@nospam.infovis.co.uk> wrote in message news:eNJyVK94JHA.1372@TK2MSFTNGP05.phx.gbl... > Hi > > I am sending a number of emails (around 600) using the vb.net code below. > The problem is that the emails end up in the OL2007 Outbox with a clock > icon and do not go out. If I open one of the email items and click Send > then that item goes out but this technique is too cumbersome for 600 or so > emails. What is the problem and how can I fix it? > > Many Thanks > > Regards > > > > Dim objOutlook As Object = CreateObject("Outlook.Application") > Dim NS As Object = objOutlook.GetNamespace("MAPI") > Dim objOutlookMsg As Object > Dim BodyText As String > Dim fso, ts > > fso = CreateObject("Scripting.FileSystemObject") > ts = fso.OpenTextFile(Me.txtHtml.Text.ToString, 1) > BodyText = ts.ReadAll > > NS.Logon() > > While .... > ' Create the message. > objOutlookMsg = objOutlook.CreateItem(0) > objOutlookMsg.To = "some address" > objOutlookMsg.Subject = "some subject" > objOutlookMsg.HTMLBody = BodyText > > objOutlookMsg.send() > > objOutlookMsg = Nothing > System.Windows.Forms.Application.DoEvents() > End While > > NS.Logoff() > NS = Nothing > > objOutlook = Nothing > > >
Sleep function in vb.net
.NET Security Equality Test For Objects .NET Marshalling Optimization - FILETIME conversion Saving and retrieving WinForm template info VS.NET 2003 to VS.NET 2008 conversion RE: Rectangle with rounded corners database layer Treeview windowstate save and restore Passing a string |
|||||||||||||||||||||||