I am using javamail in my app to read / send mails. I want to save a mail opened from Drafts back to drafts .Is it possible to edit the message and save it back. I am currently doing append which save it as a new mail.What is the right way to do it
You can't change a message in the folder. You have to add a new message and delete the old message.
Related
Currently trying to allow users to click a button in a react application to open a .docx document in their local version of word.
Have a C# rest endpoint setup that will return a document as a FileStreamResult if you pass it a document id.
Wondering if anyone has accomplished this before as I was eventually hoping that i could pass an endpoint in to the save parameter so once saved it would upload back to the server.
Tried running the ms-word command however it comes up with "this action couldn't be performed because office doesn't recognize the command it was given". ms-word:ofe|u|<>
Thanks in advance.
Im not able to send a single message from my bot using Discord JS as of v12.
I think before the update (v11) was able just by calling the channel.send('text here') but now I do not how to do it.
In detail: I want to send a message upon the bot connection and not only when someone sends a message; meaning that Im only able to send a message using the client.on('message', msg =>()
You can send messages anytime, as long as the bot is connected and ready.
The only reason why you say you "can't" send messages outside of the message event is because in the message event, you listen for a message event and respond to that message in the same channel.
You want to know how to send a message without a pre-existing message.
Go to the desired channel, right-click it, and click Copy ID. (If Developer Mode isn't on, turn it on in user settings.)
If you are using discord.js v12, use client.channels.cache.get('theChannelID').send('yourmessage'); or if you are using discord.js v11, delete the cache part.
Hope this helps.
If you want to message the same channel of the user's mess, try using message.channel.send(content)
I'm trying to scheme how I'm going to accomplish this and so far I have the following:
I grab a file in the front end and on submit send the file name and type to the back end where it generates a presigned URL. I send that to the FE. I then send the file on the front end.
The issue here is that when I generate the presign, I want to commit my UUID filename going to S3 in my database via the back end. I don't know if the front end will successfully complete this task. I can think of some janky ways to garbage collect this - but I'm wondering, is there a typically prescribed way to do this that doesn't introduce the possibility of failures the BE isn't aware of?
Yes there's an alternate way. You can configure your bucket so that it sends an event whenever an object is created/updated. You can either send this event to a SNS topic or AWS Lambda.
From there you can make a request to your Phoenix app webhook, that can insert it into the database.
The advantage is that the event will come only when the file has been created.
For more info, you can read the following: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html
The way I'm currently handling this is as such:
Compress the image client side.
Send the image to the backend application server.
Create a UUID on the backend.
Send the image from s3 to the backend, using the UUID as the key.
On success, put the UUID into the database.
Respond to the client with the UUID so it can display the image.
By following these steps, you don't introduce error into your database.
I have a GAE application which sends out email to my domain users in a Google Apps for Business environment. I am using JavaMail as described in this article. Unfortunately I can't seem to find a way to ask for a read receipt. I looked at Message methods but nothing seems to suggest that it is possible. Thanks a lot.
If you're interested in knowing if a mail bounced, then use bounce notification https://developers.google.com/appengine/docs/java/mail/bounce
For read receipts:
As far as I'm aware, you need to roll your own read receipt functionality. For example: Include an image(with a unique url) in the mail you send out. When the recipient opens the mail, the image is retrieved and you can determine whether the mail has been read. This has it's downsides; if they don't have images enabled, then you won't receive the notification.
You need to set the appropriate headers on your message, as described in Message Disposition Notification - RFC 3798. Not all mailers will honor MDNs, so you might find the tracking pixel useful as well. But then some mailers won't display remote images, so in the end there's no guaranteed way of getting notified when a message is read.
I'm working on a side project right now for an email client. I'm using a library to handle the retrieval of the messages from the server. However, I have a question on caching.
I don't want to fetch the entire list of headers everytime I load the client. Ideally, what I'd like to do is cache them and then update the list with what is on the server.
What's the best way to go about this? Should I store all the header information (including the server's message ID #) in a database, load the headers from that DB. Then as a background task sync up with the server...
Or is there a better way?
Look at the webmail sample of this open source project that use local caching:
http://mailsystem.codeplex.com/
If I remember well, he used a combination of local RFC822 plain text email storing with the message id as the filename and an index file with high level data.
Maybe the message itself where zipped to save disc space.
That's just a sample for the library, so don't expect code art there, but that's a start.