Click here to Skip to main content
14,427,367 members
Rate this:
Please Sign up or sign in to vote.
See more:
Is there any way to save mail in draft when there's no internet connectivity.? or in half way of process system disconnect internet so is there any way to save or move mail in draft.?
using smtp server and asp.net?


What I have tried:

I'm researching on it, thus nothing found useful.
Posted
Updated 10-Jan-20 3:06am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

In layman's terms, an SMTP server only has two "folders"; being "outbox" and "sent". There is no "drafts" folder; that is just a construct of the client that connects to the SMTP server.
As the developer of the client application that is originating the operation, it is up to you to perform this "draft" function locally.

An email is simply an ASCII text file, so you have multitudes of options of how to save the data within it.

1. You could create an actual folder on the hard drive for each email (hint: use a GUID or some other unique naming method) and save the individual portions of the message within it. When this message has its status changed to "sent" then move the entire folder to a "sent" directory

2. The way I store emails is within an SQL table, again using a Unique GUID as the MessageID, and you can add a BIT column to see if it has been sent or not
   
Comments
Member 14704249 10-Jan-20 8:19am
   
So if i lost connectivity in between is there any way to move mail drafts in gmail.?
Richard Deeming 10-Jan-20 11:48am
   
How would you send a command to GMail to move the message to the drafts folder if you can't connect to GMail? :)
MadMyche 10-Jan-20 11:49am
   
Well if this is being done via the GMail API, I would start with their documentation and or support pages

https://developers.google.com/gmail/api/guides

https://developers.google.com/gmail/api/support
Member 14704249 11-Jan-20 0:04am
   
Do you any code using smtp server.? or example for it.? if yes will be able to share?
MadMyche 11-Jan-20 8:18am
   
I do not work with the GMail API

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100