Click here to Skip to main content
12,451,227 members (53,324 online)
   

ASP.NET

 
QuestionMultilingual support for Web Application Pin
AB777117-Dec-12 23:18
memberAB777117-Dec-12 23:18 
AnswerRe: Multilingual support for Web Application Pin
Rahul Rajat Singh17-Dec-12 23:43
memberRahul Rajat Singh17-Dec-12 23:43 
GeneralRe: Multilingual support for Web Application Pin
AB777118-Dec-12 2:27
memberAB777118-Dec-12 2:27 
AnswerRe: Multilingual support for Web Application Pin
deflinek17-Dec-12 23:57
memberdeflinek17-Dec-12 23:57 
SuggestionRe: Multilingual support for Web Application Pin
Chandrabhan Sangale18-Dec-12 18:01
memberChandrabhan Sangale18-Dec-12 18:01 
Questiongoogle map Pin
cdpsource17-Dec-12 20:52
membercdpsource17-Dec-12 20:52 
AnswerRe: google map Pin
ryanb3118-Dec-12 4:55
memberryanb3118-Dec-12 4:55 
QuestionProblem to send message from MSMQ Pin
TRAORE cheickna17-Dec-12 10:20
memberTRAORE cheickna17-Dec-12 10: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 Pin
himadribanik17-Dec-12 6:51
memberhimadribanik17-Dec-12 6:51 
QuestionRefresh particular parts on masterpage Pin
cdpsource17-Dec-12 5:58
membercdpsource17-Dec-12 5:58 
AnswerRe: Refresh particular parts on masterpage Pin
Matt U.17-Dec-12 6:51
memberMatt U.17-Dec-12 6:51 
GeneralRe: Refresh particular parts on masterpage Pin
cdpsource17-Dec-12 6:59
membercdpsource17-Dec-12 6:59 
GeneralRe: Refresh particular parts on masterpage Pin
Matt U.17-Dec-12 7:06
memberMatt U.17-Dec-12 7:06 
GeneralRe: Refresh particular parts on masterpage Pin
cdpsource17-Dec-12 8:23
membercdpsource17-Dec-12 8:23 
SuggestionRe: Refresh particular parts on masterpage Pin
Chandrabhan Sangale18-Dec-12 18:04
memberChandrabhan Sangale18-Dec-12 18:04 
Questionsession variable / temp data Pin
xnaLearner17-Dec-12 4:25
memberxnaLearner17-Dec-12 4:25 
QuestionSalable Comet (server hang while more user) Pin
vaibhav.baldha17-Dec-12 3:47
membervaibhav.baldha17-Dec-12 3:47 
AnswerRe: Salable Comet (server hang while more user) Pin
Chandrabhan Sangale18-Dec-12 17:49
memberChandrabhan Sangale18-Dec-12 17:49 
QuestionThe underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Pin
kapil sharma 4917-Dec-12 2:02
memberkapil sharma 4917-Dec-12 2:02 
AnswerRe: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Pin
ryanb3118-Dec-12 4:58
memberryanb3118-Dec-12 4:58 
QuestionCan only book for yourself and not other users? Pin
xnaLearner17-Dec-12 1:29
memberxnaLearner17-Dec-12 1:29 
QuestionRe: Can only book for yourself and not other users? Pin
Zaf Khan19-Dec-12 5:49
memberZaf Khan19-Dec-12 5:49 
QuestionEval + onclientClick Gridview Error Pin
jojoba201116-Dec-12 20:38
memberjojoba201116-Dec-12 20:38 
QuestionRe: Eval + onclientClick Gridview Error Pin
ryanb3118-Dec-12 4:59
memberryanb3118-Dec-12 4:59 
QuestionSound transmission Pin
leone16-Dec-12 5:16
memberleone16-Dec-12 5:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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.160826.1 | Last Updated 27 Aug 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid