Click here to Skip to main content
16,008,183 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I am working on a project which reads emails using pop3 protocol, but while reading some emails from mailserver, it is showing below error ::
"Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application"

when I debugg code , it is not able to retrieve that particular emails , and stops reading of next emails of Inbox. To read next emails of that mailserver e.g pop.gmail.com, we need to manually delete or read that email.

The below command is not able to retrieve such email, I dont know specific criteria to reproduce issue, because it reproduces very rarely.


'''
''' Send RETR command to POP 3 server to fetch one particular message
'''

''' <param name="MessageNo" />ID of message required
''' <returns>false: negative server respond, message not delivered
Protected Function SendRetrCommand(ByVal messageNo As Integer) As Boolean
EnsureState(Pop3ConnectionStateEnum.Connected)
' retrieve mail with message number
Dim response As String
If Not executeCommand("RETR " & messageNo.ToString(), response) Then
CallWarning("GetRawEmail", response, "negative response for email (ID: {0}) request", messageNo)
Return False
End If
Return True
End Function


The above function of vb.net is not able to retrieve such mails.

Could you please help me on this?

Thanks in advance,
Santosh
Posted
Comments
Dave Kreskowiak 27-May-13 9:48am    
Are you writing a Windows Service app??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900