How can I configure EAGetMail DLL options to make date search work? - vb.net

Hi everyone and thanks in advance for taking the time reading my question.
I have this scenario: I'm using EAGetMail DLL to retrieve emails from a POP3 e-mail server. I have used an example given on the website and so far so good; I can get all the emails from my inbox.
My problem arises when I try to use the data filters that the DLL provides, in order to not get all the emails in the inbox, just a few, using a certain data range.
The code that I'm using for this purpose is the following:
Dim oClient As New MailClient("TryIt")
oClient.Connect(oServer)
Dim options As GetMailInfosOptionType
options = options Or GetMailInfosOptionType.DateRange
options = options Or GetMailInfosOptionType.OrderByDateTime
oClient.GetMailInfosParam.Reset()
oClient.GetMailInfosParam.GetMailInfosOptions = options
oClient.GetMailInfosParam.DateRange.SINCE = System.DateTime.Now.AddDays(-4)
oClient.GetMailInfosParam.DateRange.BEFORE = System.DateTime.Now.AddDays(1)
Theoretically this should retrieve only the emails within last four days from today, but it is not working. Everytime I execute the code I get every e-mail from my inbox.
Has someone faced something similar to this?

The first sentence on this page, regarding the MailClient.GetMailInfosParam property, says that POP3 is not supported:
Search email on IMAP4 Server and MS Exchange Server. It doesn't
support POP3 protocol.

Related

How do I disable the note when sending an email?

Is there a way to disable the creation of a "log note" when I send an email using the send_mail() method of mail.template?
Basically what I'm doing is sending an email to all team members every time a ticket is opened in the helpdesk. the problem is that in the ticket itself, it creates as many log notes for me as there are emails I send.
How can I disable the creation of log notes?
Thanks in advance
I had the same issue which you are facing so my solution :
mail_id = template_valuess.with_context(
ctx).send_mail(self.id, force_send=True)
if mail_id:
mail_obj = self.env['mail.mail'].sudo().browse(mail_id)
mail_message_id = mail_obj.mail_message_id
mail_message_id.res_id = False
It worked for me as i unlinked the res_id.
Note: If someone has better option, please add as i'm looking for alternative too.
I found the solution add auto_delete:True on template's value

ASP: SMTP authentification fails with JMail

I have a bit specific problem. One of the websites I am taking care of runs on ASP and obtains form, whose results are e-mailed to specific address.
For this to achieve, JMail component is used. As long as e-mail was sent locally (let say to user#clientserver.com through mailserver mail.clientserver.com), there was no problem and no need for authentication. However I recently got request to add another address to copy(copy#differentserver.com) and that's when problem occurred.
Firstly I tried adding authentication, however same error still occurred, when without:
jmail.Message error '8000ffff'
The message was undeliverable. All servers failed to receive the message
I tried google solutions, temper with some valuables. I am sure user and pass are correct, mail server address also worked when I wasn't try to sent mail with authentication.
Since I prefer PHP, my knowledge and skill with ASP are not of the bests. Have someone experienced something similar and solved it? Or does anyone know some other solution?
The code, which is used for sending mail:
set msg = Server.CreateOBject( "JMail.Message" )
msg.Charset = "windows-1250"
msg.Logging = true
msg.From= "from#mail.com"
msg.FromName= name&" - "&mail
'those should care of smtp auth
msg.MailServerUserName = "smtpuser#localmailserver.com"
msg.MailServerPassword = "smtppass"
'local mail address
msg.AddRecipient "user#localmailserver.com"
'outside mail address
msg.AddRecipient "address#differentmail.com"
msg.Subject = "Some subject"
msg.Body = "Some text"
if not msg.Send( "mail.localmailserver.com" ) then
Response.write "<pre>" & msg.log & "</pre>"
else
'Succesfully sent, redirect
Response.Redirect("mailjob_sent.asp")
end if
So the problem is solved at last. After help with analysis by my colleagues responsible for local mailserver, we found out, the problem was username for SMTP authentification.
I got confused, since it wasn't smtpuser#localmailserver.com (I'm referring to example I made), but
smtpuser#localdomainname.com.
So advice for others with similar problem, try to add testing account(one you are using for authentification) to your e-mail client(i.e. Thunderbird) and once that is allright, you have right credentials. Also try sending mail from that account elsewhere.

I am trying to use Yodlee/executeUserSearchRequest as a RESTful request and need an answer on how to call

I am working with the Yodlee services in c# and using the RESTful api. So far I have successfully connected and logged in with my CobrandSession and UserSessionToken in the development environment. I used the sample apps provided in c# and with some advice from shreyans i got an app working. What I got working was
1) Get YodleeAuthentication
2) Get UserAuthentication
3) Get ItemSummaries
I am now trying to get the full transaction details for each of the Items (i.e. collections of accounts that are an Item)
reading the Docs here https://developer.yodlee.com/Indy_FinApp/Aggregation_Services_Guide/REST_API_Reference/executeUserSearchRequest it states that I need to call executeUserSearchRequest and then paginate through the results using the getUserTransactions. So I am stuck at this point. I dont really want a search which has parameters I just want ALL transactions for this account that I can see.
However, I am using the variables as defined in that page :-
var request = new RestRequest("/jsonsdk/TransactionSearchService/executeUserSearchRequest", Method.POST);
request.AddParameter("cobSessionToken", param.CobSessionToken);
request.AddParameter("userSessionToken", param.UserSessionToken);
request.AddParameter("transactionSearchRequest.containerType", param.ContainerType);
request.AddParameter("transactionSearchRequest.higherFetchLimit", param.HigherFetchLimit);
request.AddParameter("transactionSearchRequest.lowerFetchLimit", param.LowerFetchLimit);
request.AddParameter("transactionSearchRequest.resultRange.endNumber", param.EndNumber);
request.AddParameter("transactionSearchRequest.resultRange.startNumber", param.StartNumber);
request.AddParameter("transactionSearchRequest.searchFilter.currencyCode", param.CurrencyCode);
request.AddParameter("transactionSearchRequest.searchFilter.postDateRange.fromDate", param.FromDate);
request.AddParameter("transactionSearchRequest.searchFilter.postDateRange.toDate", param.ToDate);
request.AddParameter("transactionSearchRequest.searchFilter.transactionSplitType.splitType", param.SplitType);
request.AddParameter("transactionSearchRequest.ignoreUserInput", param.IgnoreUserInput);
request.AddParameter("transactionSearchRequest.searchFilter.itemAcctId", param.ItemAcctId);
var response = RestClientUtil.GetBase().Execute(request);
var content = response.Content;
return new YodleeServiceResultDto(content);
As per the response from shreyans in this posting Getting Error "Any one of [**] of transactionSearchFilter cannot be NULL OR Invalid Values I am not putting in the ClientId and the ClientName
The documentation doesn't specify the format of the dates but the example seems to tell me that its american date format. And specifies a parameter saying IgnoreUserinput, but doesnt have a parameter for user input so this is confusing
When I make a call using this format I get an error response
var getSearchResult = yodleeExecuteUserSearchRequest.Go(yodleeExecuteUserSearchRequestDto);
getSearchResult.Result="
{"errorOccured":"true","exceptionType":"Exception Occured","refrenceCode":"_60ecb1d7-a4c4-4914-b3cd-49182518ca5d"}"
But I get no error message in this and I have no idea what I have done wrong or where to look up this error, can somebody who has used Yodlee REST Api point me in the right direction as I need to get this researched quickly....
thanks your your help, advice, corrections and pointers....
Here is the list of parameters which you can try
1) For a specific ItemAccountId all transactions
transactionSearchRequest.containerType=all
transactionSearchRequest.higherFetchLimit=500
transactionSearchRequest.lowerFetchLimit=1
transactionSearchRequest.resultRange.startNumber=1
transactionSearchRequest.resultRange.endNumber=500
transactionSearchRequest.searchClients.clientId=1
transactionSearchRequest.searchClients.clientName=DataSearchService
transactionSearchRequest.searchFilter.currencyCode=USD
transactionSearchRequest.searchClients=DEFAULT_SERVICE_CLIENT
transactionSearchRequest.ignoreUserInput=true
transactionSearchRequest.ignoreManualTransactions=false
transactionSearchRequest.searchFilter.transactionSplitType=ALL_TRANSACTION
transactionSearchRequest.searchFilter.itemAccountId.identifier=10000353
2) For a Specific account (itemAccountId) with start and end dates
transactionSearchRequest.containerType=all
transactionSearchRequest.higherFetchLimit=500
transactionSearchRequest.lowerFetchLimit=1
transactionSearchRequest.resultRange.startNumber=1
transactionSearchRequest.resultRange.endNumber=500
transactionSearchRequest.searchClients.clientId=1
transactionSearchRequest.searchClients.clientName=DataSearchService
transactionSearchRequest.searchFilter.currencyCode=USD
transactionSearchRequest.searchClients=DEFAULT_SERVICE_CLIENT
transactionSearchRequest.ignoreUserInput=true
transactionSearchRequest.ignoreManualTransactions=false
transactionSearchRequest.searchFilter.transactionSplitType=ALL_TRANSACTION
transactionSearchRequest.searchFilter.itemAccountId.identifier=10000353
transactionSearchRequest.searchFilter.postDateRange.fromDate=08-01-2013
transactionSearchRequest.searchFilter.postDateRange.toDate=10-31-2013

Debugging K2 workflow - how to view data associated with error conditions?

I have a K2 Blackpearl workflow. In the workflow I populate a process data field with email addresses pulled from a SharePoint list. Using the Text - Join function with the SP List's SmartObject's GetList method for the values and a semi-colon for the separator.
In theory, this should produce a well-formatted string with multiple addresses for the "To" line of the E-mail event. However, I keep receiving a "The specified string is not in the form required for an e-mail address." at the point where the workflow should attempt to send an email.
I've tried using the string "john.doe#company.com;jane.dove#company.com;abc.def#company.com" directly and I've tried splitting the string on the semi-colons in the Activity's destination set. In the first case, there is one instance trying to send the email. In the second instance, the emails are resolved to users and though I select the "ActivityInstanceDestUserEmail" for the "To" line, I still get the error message.
We are using K2 Blackpearl 4.6 with a SharePoint 2010 farm configured strictly for Claims authentication. The users to which I wish to send the email have valid email addresses if resolved using the K2SPS provider, but when the emails are resolved into destination slots, they are resolved into accounts with the K2 provider. I'm guessing that this is the problem with my second method for sending the email. But the first, putting the whole string in the "To" line should have worked it is straight email addresses - no resolving to users is needed.
What am I doing wrong? Is there another way to accomplish this?
Changes in the configuration of our customer security provider, labelled "K2SPS" seem to have resolved the problem - at least for now.

Check if mail was successfully sent in VB.NET with SMTPClient

I'm trying to create an application that sends an email to an smtp-server.
The server is not set fixed, but will be looked up according to the domainpart of the email-address where the email should be sent to.
Example:
Email To: test#stackoverflow.com
Domain-Part: stackoverflow.com
Result of a MX-Record Lookup (commandline "nslookup -type=mx stackoverflow.com":
stackoverflow.com MX preference = 30, mail exchanger = stackoverflow.com.s9b1.psmtp.com
stackoverflow.com MX preference = 40, mail exchanger = stackoverflow.com.s9b2.psmtp.com
stackoverflow.com MX preference = 10, mail exchanger = stackoverflow.com.s9a1.psmtp.com
stackoverflow.com MX preference = 20, mail exchanger = stackoverflow.com.s9a2.psmtp.com
It would be quite useful, to know if the message was accepted by the mailserver and the message was successfully sent.
What I am able so far is, that I can get the SMTP-Server error code (if there was an error (StatusCode 5xx) by using the System.Net.Mail.SMTPClient Object and its SendAsync Function. There, if there was an error, I get an Exception-Object in the Callback-Event of the SMTPClient
I'm well aware that not every mailserver will tell me if the mailaccount truly exists and then reject my mail with an errorcode but instead just accept the message and then delete it. Therefore I would be grateful for another Method to check if the mail was sent (note: not read, that would be the read confirmation)
The final purpose would be:
Try to send an email to a recipient using it's domains mailserver and if it fails, proceed according to the errorcode (user does not exist -> abort / mailserver did not respond -> use another mailserver if available).
Thanks in advance (and sorry for typos :))
Unfortunately what you are looking for does not exist. Email jumps through so many hops that there is no definition of what "sent" actually means. For instance, your example of stackoverflow actually points to Postini's email servers. Postini probably passes the email around from gateways to AV's and routers. From there they either pool email or pass them on to another email server.
With email, the closest definition of "sent" is "at least I didn't get an error".
Also, a minor thing, but when using nslookup remember to add a trailing period to the domain, otherwise the domain search list is used. Generally not a big deal but every once in a while it might trip you up.
nslookup -type=mx stackoverflow.com.