PRSMTPADDRESS Url is temporarily unavailable - outlook

I am trying to access the URL: http://schemas.microsoft.com/mapi/proptag/0x39FE001E and I am getting a result as follows:
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
I use this URL to get SMTP address of the Exchange agent.
My code is as follows
string PR_SMTP_ADDRESS = #"http://schemas.microsoft.com/mapi/proptag/0x39FE001E";
PropertyAccessor pa = sender.PropertyAccessor;
email = pa.GetProperty(
PR_SMTP_ADDRESS) as string;
COMHelper.ReleaseComObject(ref pa);
Any help would be appreciated.

That is not a URL, it is a DASL property name. Much like a namespace in HTML/XML/etc.

As Dmitry mentioned, this is a Namespace. You can refer to the following link to know more information.
Referencing Properties by Namespace
Get named MAPI Property from MailItem in C#

See How to: Get the SMTP Address of the Sender of a Mail Item.
Also you may find the HowTo: Convert Exchange-based email address into SMTP email address article helpful.

Related

Http Post request in Microsoft Bot Composer

I have tried below but http request got fails is there I missing something can anyone guide me please. In postman by using qnaId in the body I am getting the correspond queastion and answer in json response. The same I have tried in composer with Http request but it fails.
{
"qnaId" : "1164"
}
enter image description here
enter image description here
The same I tried in Postman and successfully got the response.
enter image description here
Thanks....
I think the issue is that $Qna is not a valid memory variable. Per documentation, you need to set this in either conversation, dialog, turn or user scopes. I had missed the section in the post here where the response was being set to $Qna. That's not valid. So, it needs something like turn.Qna or dialog.Qna.
Additionally, the use of $ should be used only for string interpolation, not in setting the variable name. turn.Qna would set it and you would utilize it in a string as: "You said: ${turn.Qna}"

Inappropriate behaviour of ImapMailReceiver

If the password contains #, ImapMailReceiver failed to return host correctly.
for example:
username: abc#gmail.com
password: abc#123
host: imap.gmail.com
Final URI string
imap://abc#gmail.com:abc#123#imap.gmail.com:993/INBOX
then, ImapMailReceiver identify host as 123#imap.gmail.com
I checked this thread but I use JavaConfig way to create ImapMailReceiver where as the thread is about XML config way.
Any way to walk around of this issue?
Thanks!
UPDATE
Final URI string with encoding
imap://abc%40gmail.com:abc%40123#imap.gmail.com:993/INBOX
in this case, I got AuthenticationException.
May be above information help you to understand the problem.
UPDATE 1
above was an issue from Gmail. One need to enable LESS SECURE APP security option in Gmail to fix Authentication related issue.
RFC 1738 says:
Within the user and password field, any ":", "#", or "/" must be encoded.
I expect you already know how URL encoding works. If you want a refresher, page 18 of the same document is a good place to start.
I encountered the same problem with an Office 365 account, where the user name is like 'your-user#your-company.com' and the host is 'outlook.office365.com'. Without encoding the user name, 'your-company.com' is used as the host, which leads to the following (a bit misleading) error:
javax.mail.AuthenticationFailedException: failed to connect, no password specified?
Activating debugging with mail.debug=true ...
mailProps.put("mail.debug", "true");
receiver.setJavaMailProperties(mailProps);
... gives us the parameters used for the connection to the mail server.
DEBUG IMAPS: protocolConnect returning false, host = your-company.com, user = your-user, password = <null>
To resolve the issue, I used URLEncoder.encode for the username and password, e.g.:
...
new StringBuilder("imaps://")
.append(URLEncoder.encode(mailSettings.getUser(), StandardCharsets.UTF_8.toString()))
.append(":")
.append(URLEncoder.encode(mailSettings.getPassword(), StandardCharsets.UTF_8.toString()))
...

ActionMailer fail with "Value cannot be null. Parameter name: uriString"

I'm trying to use ActionMailer 0.7.0 to send a email from my MVC 3 project.
I've followed the sample posted in the project site to the letter.
But when I try to send the email the following error always occurs:
"Value cannot be null. Parameter name: uriString"
It occurs the the #Url.AbsoluteAction in the email body.
#using ActionMailer.Net
#model User
#{
Layout = null;
}
Welcome to My Cool Site, #Model.FirstName
We need you to verify your email. Click this nifty link to get verified!
// The error happens in the line bellow
#Url.AbsoluteAction("Verify", "Account", new { code = #Model.EmailActivationToken.ToString() })
Thanks!
Can some one help me? What am I missing?
After struggling a few days trying to solve the problem using the code proposed in the sample I gave up.
I've download the source and found out that the problem occurs when your RouteCollection is not standard (which is my case).
So I found an elegant work around that worked for me.
Instead sending the Token to the view and use the Url.AbsoluteAction method I used the Url.Action with the protocol parameter in the controller and sended the complete url in the view model. Like this:
new EmailsController().ActivationMail(new ActivationMailViewModel { Email = data.Email, FirstName = data.Name, ActivationLink = Url.Action("VerifyEmail", "Mail", new { code = data.ActivationToken.ToString() }, "http") }).Deliver();
The view became:
#using ActionMailer.Net
#model User
#{ Layout = null; }
Welcome to My Cool Site, #Model.FirstName
We need you to verify your email. Click this nifty link to get verified!
#Model.ActivationLink
Thanks!
About the SMTP host problem, I found out that in Web.Config even if you set the deliver for "SpecifiedPickupDirectory" you need to add an empty host tag. It's not specified in any ActionMailer sample. Here is the final configuration:
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory">
<network host="none" />
<specifiedPickupDirectory pickupDirectoryLocation="C:\temp\" />
</smtp>
</mailSettings>
</system.net>
I hope it helps someone.
Best luck for everybody.
I've just spent a couple of hours implementing ActionMailer into my MVC project.
I found Scott's screencast really helped me.
http://www.youtube.com/watch?v=QQRzYo7k9Vs&hd=1
It explains how to get round the SMTP host issue, as well as how to set up the User models etc.
I'm still getting stuck on user email verification and will try to let you know if I sort it out.
However, you don't need this to send 'ordinary' emails. So my advice would be to leave it out for now until you can get the emails working OK.
Hope that helps, and I'll be back to you when I sort out email verification!
Cheers
Chewie

Best PHP mailing library for Codeigniter-2

Iam using CI-2 default mail class for sending emails. But it is not sending HTML based emails properly.
Can someone tell me good email sending libraries for CI2.
Thanks in advance
Try to configure the library to send html emails
$config['mailtype'] = 'html';
$this->email->initialize($config);
gmail and HTML content is a common problem; solutions have been suggested in the official CI forum with references to using Swift Mailer instead.
There is another solution I've found for poor HTML / Email Support.
Open up the Email Class:
System/Libraries/Email.php
Around Line 51 You'll see
var $send_multipart = TRUE;
Set this to FALSE and try again. I find CI's email library to be very good.

WebDAV query for Exchange

I am trying to read a public calendar (in public folders) in my Exchange server.
I am sending the following query to my Exchange server, and the server replies with 400 - Bad Request.
<?xml version=""1.0""?>
<g:searchrequest xmlns:g=""DAV:"">
<g:sql>
SELECT
""urn:schemas:httpmail:subject"",
""urn:schemas:calendar:location"",
""urn:schemas:calendar:dtstart"",
""urn:schemas:calendar:dtend""
FROM
Scope('SHALLOW TRAVERSAL OF ""https://server/public/SomeFolder/SomeCalendar/""')
</g:sql>
</g:searchrequest>
Now that same query works with this store URL:
https://server/exchange/username/calendar/
So I know that's the URL that is wrong in the query.
If I paste the problematic URL in my web browser, it will come up with the calendar, so the URL does seem fine though.
Any help appreciated.
Thanks
Xavier
Try
https://server/public/SomeFolder/SomeCalendar/?cmd=contents
Thanks SillyMonkey for your input.
Your URL returned the same error but I have found out the problem was with the endpoint I was connecting to to submit the query.
I was posting the query to this URI:
string uri = string.Format("{0}/exchange/{1}", server, credentials.UserName);
and now changed it to:
string uri = string.Format("{0}/public", server);
I am a bit surprised that I have to use different endpoints depending whether I am querying the user's mailbox or the public folders, but it seems to be the way it is.

Resources