Update to Mailer.cs not changing based on email - c#

I had to change the email addresses that are involved in an app to a different set. The app just sends notifications when a form is submitted to the user and the admin for a confirmation. I went into the app files and did nothing but switch out the email address in the mailer.cs file. It doesn't seem to be effecting anything and it's still going to the old email and using the old email when sent to the user. Do I need to do more than that? This is an old app and I'm actually in the process of creating an updated replacement in a back-burning project, I'm not quite familiar with the detailed workings of it. I am manually editing these files and not using the UI if that makes any difference.

Is it a web application project? If so you need to build it through visual studio.
If it was created as a website project then try touching the web.config (like putting in a space or a line break anywhere and hit save) so it may try to re-compile.

Related

Typing indicator shows even afterr message is sent Bot Framework Composer

Exactly what the title says. I've been trying to implement the typing indicator (befor bot sends a message) for a bot created through Bot Framework Composer. The guidelines are to set the the showTyping property in appsettings.json to true but when I do this it will sometimes displays the typing indicator before the bot sends a message but sometimes it will display the typing indicator after the bot message.
I've already looked up this error and there doesn't seem to be support on it anywhere for Bot Framework Composer but there are resources for this same issue occurring using Bot Framework SDK. I have extensively read and tried all the suggestions for the SDK version but can't seem to get it to work. I don't know if I'm missing some code that hooks the components together but I've done a number of things which generally include
Creating a CustomShowTypingMiddleware.cs
Create and edit the AdapterWithErrorHandler.cs
Use the adapter in Startup.cs
I don't know if something else is meant to be added to any of the other composer c# files (ex. BotController.cs, Program.cs) but these were the changes I noticed in the code samples so this is all I added. By making these changes, it seems to do nothing. It doesn't break the bot but it doesn't add any typing functionality either. An alternative I've tried that was working only locally was creating a custom middleware component (following this https://learn.microsoft.com/en-us/composer/how-to-create-custom-actions?tabs=csharp#export-the-bot-runtime), referencing it inside my composer bot and then adding the name of the new component to my components array in appsettings.json. This successfully sent the typing activity and showed it in chat locally but whenever I would deploy the code to Azure and Test in Webchat or use it in our client application linked to this hosted Azure bot, it would always send back a 502/500 error saying that there's a missing secret or token on the request webchat/join when in fact the Authorization header shows otherwise.
I would appreciate any help on trying to make either methods (adapter or custom component) work or a new one if there is anything else.
#owenpww
Setting "showTyping":"true" is all that is needed to enable the typing middleware, as you have found.
There are a few aspects to the how the typing middleware works. There is the delay on how long the request has to continue before any typing activity is sent. Think of this as the threshold that is wanted, to allow the bot to reply before any typing activity is sent. The default is 500ms. The second aspect is how often/frequent typing activities are sent before the response is sent and typing activities are cancelled. The default is every 2 seconds. You can see this here. The third aspect is how long the client wants to render their typing activity. The spec recommends displaying for 3 seconds. Looks like webchat is at least close to that. The spec also says that the clients can clear the activity if it is assigned an id.
So, the question I have is; what are you seeing in WebChat/Emulator (does it even behave the same in Emulator?) with regards to the order of typing activities coming in and relation to the message activity. Do you see multiple typing activities? Do you they show in the correct order in the trace, but in the wrong order in the chat (what the user sees)? If you are able to massage your bot to take longer/shorter responses (no longer than 15 seconds), how does that affect the behavior?
Here's what you would look for in Emulator or Composer Webchat:
it turned out the problem with my custom bot component implementation was that it was an external project.
I think because the docs are a littled dated. They reference a .sln file that as far as I know does not exist anymore in the template Composer projects. Because of this, I created a blank solution in VS where I opened my existing bot project and created a new project for the component. I mainly followed the instructions here which are very similar to the docs (just specifically for components instead of actions) but at the end I moved the component project into the bot project directory. Then I adjusted the project reference in the <bot>.csproj to point to the newly moved component project. Added some <Generate...Attribute>false</Generate...Attribute> attributes in <PropertyGroup> of the <component>.csproj (again now in the bot project instead of outside of it) to remove the duplicate attribute errors I was getting. Deleted the bin/ and obj/ directories of both the bot project and the component project. Then it worked fine both locally and on Azure.

Where is the standard place to leave a Json file for an app when working on a mobile app?

I am developing a mobile app to connect to a centralized web-server, this app use a login sistem to do that, and i like to save the credentials in a file inside the mobile phone so the user doesn't need to make manualy the log-in every single time is connecting to the app.
For your tranquility, yes, the conection is API REST, AND the credentials are going to be sended for every operation, BUT the data Receiver of the web-server is well controled in a security level.
then what i want it to save user login info (the user on the mobile app) localy in order to send the data every time it will be needed to be sended,
for that i think in save it to a JSON file in some folder, so...
the question is:
What folder that should it be?
I think i probably can make it anywhere, but if you provide the path where, by standard -or at least by good practice- must be store, then i pretty much take that like the answer of my question (specialy if do it there is safer than in any other place inside the mobile phone)
Idealy it must be a place where, when the app is uninstalled, the file also be removed.
Thanks in advance

asp.net or windows service that listen to if you get a Email

I am trying to make a program that will listen to if I recieve a E-mail I got a smtp server and so on.
I want to make a database object with Title and text from the Mail and I might want to evolve it into also saving the attacted file to the database so I can use it it my asp.net program.
I think I need a windows Service that will be listening to the email if it gets a email it will add it to datbase and wait again but I am not sure how to do that. if its possible to program that into my asp.net project then it would be a good thing also
Here is a small design on how I was thinking about it
if you know anything about it feel free to come up with any kind of solutions for me.
Read incoming emails with POP3 or Exchange. I've made something similar before, which was a system where users could add links (a type of linking-scam actually) to different websites. So there was a bunch of people in Asia that had a full-time job searching for relevant sites and emailing a list of these URL's to a specific email-address. A service I had running would check the POP3 inbox every 5 minutes or so and then post these links to the website.
You should make an application that gets run at specific intervals rather than a service, which is much simpler. If you're using Azure as a host you can use the scheduled task service there to make a POST call to a page on your site so you don't have to run the code in a different eco-system. Well, I guess you can do that anyway with scheduled tasks in windows.
Here's a POP3 client for .NET
You could make a C# service that checks the pop3 server in a configured interval, and store them in the DB. There's something like this here:
http://aspsnippets.com/Articles/Fetch-and-Read-emails-from-POP3-mail-server-using-C-and-VB.Net---Part-I.aspx
But as a regular application, you just have to make it to run as service (I think you have a project template for that in VS). You have some info here:
http://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx
Okay I figured out a good solution for this problem friends :)
What I did was I downloaded the EAGetMail and implamentet it. it basicly works for you in a time interval it will check your mail and make a txt file with all the mails so it wont read it again. it also got a aplication field so everytime it runs it will run the selected application.
So I made a console application that runs trough my folder where it will save all my email's as .eml file. It will check for a sub folder called read if its not there then create it and then check the root folder for .eml files read them and save information from it to the database and then move the file to read.
We did not want to use pop3 cuz we wanted the mails to stay intact så we dont lose any information. so we ran for the IMAP4.
and in the asp.net I just run a query that checks the database and use the files.

Open Outlook application/ desktop to send mail via Windows 8 App

I am creating a windows 8 app to send mail from the entered fields. There are two approaches that i have tested and tried. But each one has its own limitation. My requirement is simple to send mail via outlook desktop app for the user. The content body of the mail is well formatted hence I used HTML to create it(Other ways if any let me know), there is an image attachment also of the InkManager used to take user sign.
Approach 1: Use share charm. All things work well but some times the app stops sharing then I need to restart or logoff from that account and then again login. And the clients wants to open his/ her outlook
Approach 2: Use mailto and open using Launcher.LaunchUriAsync it gives me an option to choose outlook but I can't set the HTML content formatted and unable to put the InkManager used to take user sign as an image
How can I solve this issue?
If you need to send the mail from the user's account these are the only two ways. Alternatives are using an external web service as Filip suggested or sending it directly from the app using a mail API such as Mail for Windows Store.
I have another remark regarding the first approach, though. In my experience the sharing typically stops working until the next logon when an app does something wrong handling the DataRequested event - this breaks the share charm for all the apps. If it happens to you during development or testing your own app, make sure you handle any exceptions that might happen in the event handler and also check that you are adding and removing the event handler properly. Also avoid stopping the app within this event handler when debugging. This should prevent the issue from occuring.
The best way right now is to write/connect to a web service that sends the mail. I think there might be existing ones out there.

C# - Send message to an Active Directory user

I would like to send a message to an Active Directory user so when he/she loggs in next time they see the message though a popup window. Is it possible to do it in any way beside using the usual netsend?
This is usually a mess when trying to push out a message to a user. If you want a message to pop up, I would suggest that you create a small application with a pull mechanism. When the user logs in, the application should run to determine if they have a message waiting (messages could be in a central database or even file location). If they do, the application could pop up the message. In this way, the application would also bypass most of your firewall/network segment issues. You would only need to open communication to a central location for the data rather than diagnosing network issues for every client.
Not only would this method allow you to do exactly what you are asking for, it would allow you to expand your application to do even more. For example, you could require the user to acknowledge the message in a more formal way than just hitting OK (maybe make them check a box first saying "I read and understand the message"). You could also capture the time when the user saw the message (they might not log in for hours after you send the message). It could also be used when the user is currently logged in and you want to send them a message (the app could poll the server).
While there are downsides to this method (creating an app, installing it everywhere, managing it, etc.) I think the benefits would outweigh the downsides if you really need to have a notification system like you are specifying.
On Windows 2003 you've got an old fashion way of doing that.
In the scriptPath attribut of the AD user nod, you put the name of a script or exe file for example username.cmd.
On your DC, you've got a folder C:\WINDOWS\SYSVOL\sysvol\DOMAIN.NAME\SCRIPTS shared with the name NETLOGON. you just create the file username.cmd in this folder. the program username.cmd is going to be played on every logon of the user. In this file you can put a popup message.
It's still working on Windows Server 2008 R2.

Categories

Resources