Click here to Skip to main content
       

ASP.NET

 
QuestionMultilingual support for Web Application PinmemberAB777118-Dec-12 0:18 
AnswerRe: Multilingual support for Web Application PinmemberRahul Rajat Singh18-Dec-12 0:43 
GeneralRe: Multilingual support for Web Application PinmemberAB777118-Dec-12 3:27 
AnswerRe: Multilingual support for Web Application Pinmemberdeflinek18-Dec-12 0:57 
SuggestionRe: Multilingual support for Web Application PinmemberChandrabhan Sangale18-Dec-12 19:01 
Questiongoogle map Pinmembercdpsource17-Dec-12 21:52 
AnswerRe: google map Pinmemberryanb3118-Dec-12 5:55 
QuestionProblem to send message from MSMQ PinmemberTRAORE cheickna17-Dec-12 11:20 
Hello,
 
I created a WCF service into my asp.net app in order to store some messages into queue using MSMQ before send them to users. The first part work fine because i can see all messages in a pickup directory with Windows Explorer. I also can see the message number using windows service manager throw my private queue.
 
The second part don't work i.e my messages aren't sent and i have no error message. I don't understand where the problem come from. The code i use is following :
 
msmqQueuePath is my Queue name
 
Public Sub GetMailMessages() Implements ISvcEmailManagement.GetMailMessages
 
        Try
            ' Create an instance of MessageQueue. Set its formatter.
            Dim _msmqQueue As New MessageQueue(msmqQueuePath)
            '_msmqQueue.Formatter = New XmlMessageFormatter(New Type() {GetType([String])})
            _msmqQueue.Formatter = New BinaryMessageFormatter
            _msmqQueue.MessageReadPropertyFilter.SetAll()
            ' Add an event handler for the ReceiveCompleted event.
            AddHandler _msmqQueue.ReceiveCompleted, AddressOf msmqQueue_ReceiveCompleted
            Dim returnValue As IAsyncResult
            ' Begin the asynchronous receive operation.
            returnValue = _msmqQueue.BeginReceive()
            signal.WaitOne()
            ' Do other work on the current thread.
            Return
        Catch ex As Exception
            Dim Msg As String = ex.Message
            Throw ex
        End Try
 
    End Sub
 
 
The receiveCompleted function is :
 
Public Sub msmqQueue_ReceiveCompleted(ByVal sender As Object, ByVal e As ReceiveCompletedEventArgs)
        Try
            Dim emailMsg As EmailEntities.CEmailMessage = e.Message.Body
            'Remplir l'objet Message avec TO, FROM, BODY, SUBJECT en supposant que le message soit au bon format
            Dim mailMessage As MailMessage = New MailMessage()
            mailMessage.To.Add(New MailAddress(emailMsg.sTO))
            mailMessage.From = New MailAddress(emailMsg.sFROM)
            mailMessage.Subject = emailMsg.sSUBJECT
            mailMessage.Body = emailMsg.sBODY
            Dim oclient As SmtpClient = New SmtpClient()
            Try
                oclient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory
                oclient.Send(mailMessage)
            Catch ex As SmtpFailedRecipientsException
                Dim i As Integer
                For i = 0 To ex.InnerExceptions.Length - 1
                    Dim status As SmtpStatusCode = ex.InnerExceptions(i).StatusCode
                    If (status = SmtpStatusCode.MailboxBusy) Or (status = SmtpStatusCode.MailboxUnavailable) Then
                        'Echec à l'envoi du message : tentative dans 5 secondes
                        System.Threading.Thread.Sleep(5000)
                        oclient.Send(mailMessage)
                    Else
                        'Echec d'envoi du message à {0}
                        MsgBox("Failed to deliver message to {0}", MsgBoxStyle.Information, ex.InnerExceptions(i).FailedRecipient)
                    End If
                Next i
            Catch ex As SmtpException
                Dim msstatus As String = ex.Message
            End Try
        Catch ex As SmtpException
            Dim msstatus As String = ex.Message
        Catch ex As Exception
            Dim msstatus As String = ex.Message
            'Catch ex As XmlException
            '    Dim msstatus As String = ex.Message
        End Try
    End Sub
 

Thanks a lot for any help
Questionexport report failed in crystal report Pinmemberhimadribanik17-Dec-12 7:51 
QuestionRefresh particular parts on masterpage Pinmembercdpsource17-Dec-12 6:58 
AnswerRe: Refresh particular parts on masterpage PinmemberMatt U.17-Dec-12 7:51 
GeneralRe: Refresh particular parts on masterpage Pinmembercdpsource17-Dec-12 7:59 
GeneralRe: Refresh particular parts on masterpage PinmemberMatt U.17-Dec-12 8:06 
GeneralRe: Refresh particular parts on masterpage Pinmembercdpsource17-Dec-12 9:23 
SuggestionRe: Refresh particular parts on masterpage PinmemberChandrabhan Sangale18-Dec-12 19:04 
Questionsession variable / temp data PinmemberxnaLearner17-Dec-12 5:25 
QuestionSalable Comet (server hang while more user) Pinmembervaibhav.baldha17-Dec-12 4:47 
AnswerRe: Salable Comet (server hang while more user) PinmemberChandrabhan Sangale18-Dec-12 18:49 
QuestionThe underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Pinmemberkapil sharma 4917-Dec-12 3:02 
AnswerRe: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Pinmemberryanb3118-Dec-12 5:58 
QuestionCan only book for yourself and not other users? PinmemberxnaLearner17-Dec-12 2:29 
QuestionRe: Can only book for yourself and not other users? PinmemberZaf Khan19-Dec-12 6:49 
QuestionEval + onclientClick Gridview Error [modified] Pinmemberjojoba201116-Dec-12 21:38 
QuestionRe: Eval + onclientClick Gridview Error Pinmemberryanb3118-Dec-12 5:59 
QuestionSound transmission Pinmemberleone16-Dec-12 6:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 28 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid