Index: GMail.lua
===================================================================
--- GMail.lua	(revision 16179)
+++ GMail.lua	(working copy)
@@ -510,7 +510,7 @@
 			end
 		end
 	end
-	if ( this.num and this.elapsed ) then
+	if ( not this.returnSelected and this.num and this.elapsed ) then
 		this.elapsed = this.elapsed - elapsed
 		if ( this.elapsed <= 0 ) then
 			this.elapsed = nil
@@ -540,6 +540,37 @@
 			end
 		end
 	end
+	if ( this.returnSelected and this.num and this.elapsed ) then
+		this.elapsed = this.elapsed - elapsed;
+		if ( this.elapsed <= 0 ) then
+			this.elapsed = nil;
+			if ( this.id[1] ) then
+				local val = this.id[1];
+				local success = GMail_Inbox_ReturnMail(val, this.returnSelected);
+				if ( success ~= 2 ) then
+					tremove(this.id, 1);
+					this.num = this.num - 1;
+				end
+				if ( success == 1 ) then
+					for key, va in this.id do
+						if ( va > val ) then
+							this.id[key] = va-1;
+						end
+					end
+					this.lastVal = val;
+					InboxFrame_Update();
+				else
+					this.elapsed = 1+GMail_DELETEDELAY;
+					this.lastVal = nil;
+				end
+				if ( this.num == 0 ) then
+					this.num = nil;
+					GMail:Inbox_DisableClicks(nil)
+					this.returnSelected = nil;
+				end
+			end
+		end
+	end
 	if ( this.delete ) then
 		this.delete[1] = this.delete[1] - elapsed
 		if ( this.delete[1] <= 0 ) then
@@ -653,6 +684,42 @@
 	GMail_SelectedItems = { }
 end
 
+function GMail_Inbox_ReturnMail(id, returnSelected)
+	if ( not id ) then
+		return 0;
+	end
+	local packageIcon, stationeryIcon, sender, subject, money, CODAmount, daysLeft, hasItem, wasRead, wasReturned, textCreated, canReply = GetInboxHeaderInfo(id);
+
+	GMail:Print(format(GMAIL_RETURN_FORMAT, this.numMails-(this.num-1), this.numMails, (subject or GMAIL_NOSUBJECT), (sender or GMAIL_UNKNOWNSENDER)), 1, 1, 0)
+
+	local eventDelete;
+
+	ReturnInboxItem(id);
+
+	if ( eventDelete ) then
+		GMailInboxFrame.eventDelete = id;
+	else
+		GMailInboxFrame.delete = { GMail_DELETEDELAY, id };
+	end
+	return 1;
+end
+
+function GMail_Inbox_ReturnSelected()
+	GMail:Inbox_DisableClicks(1)
+	GMailInboxFrame.num = 0
+	GMailInboxFrame.elapsed = GMail_DELETEDELAY
+	GMailInboxFrame.id = { }
+	GMailInboxFrame.returnSelected = 1;
+
+		for k, v in pairs(GMail_SelectedItems) do
+			GMailInboxFrame.num = GMailInboxFrame.num + 1
+			tinsert(GMailInboxFrame.id, v)
+		end
+
+	GMailInboxFrame.numMails = GMailInboxFrame.num
+	GMail_SelectedItems = { }
+end
+
 function GMail:InboxFrame_Update()
 	self.hooks["InboxFrame_Update"]()
 	for i = 1, 7, 1 do
Index: GMail.xml
===================================================================
--- GMail.xml	(revision 16179)
+++ GMail.xml	(working copy)
@@ -783,6 +783,23 @@
 			</OnClick>
 		</Scripts>
 	</Button>
+	<Button name="GMailInboxReturnSelected" parent="InboxFrame" inherits="UIPanelButtonTemplate" text="GMAIL_INBOX_RETURNSELECTED">
+		<Size>
+			<AbsDimension x="120" y="25"/>
+		</Size>
+		<Anchors>
+			<Anchor relativePoint="TOP" point="CENTER">
+				<Offset>
+					<AbsDimension x="-15" y="-405"/>
+				</Offset>
+			</Anchor>
+		</Anchors>
+		<Scripts>
+			<OnClick>
+				GMail_Inbox_ReturnSelected();
+			</OnClick>
+		</Scripts>
+	</Button>
 	<Button name="GMailInboxOpenAllButton" parent="InboxFrame" inherits="UIPanelButtonTemplate" text="GMAIL_INBOX_OPENALL">
 		<Size>
 			<AbsDimension x="120" y="25"/>
Index: localization.lua
===================================================================
--- localization.lua	(revision 16179)
+++ localization.lua	(working copy)
@@ -16,6 +16,7 @@
 GMAIL_ERROR = "An error occured in GMAIL. This might be related to lag, trying to send items with an item placed in the normal send mail window, or trying to send items that cannot be sent.";
 
 GMAIL_INBOX_OPENSELECTED = "Open Selected";
+GMAIL_INBOX_RETURNSELECTED = "Return Selected";
 GMAIL_INBOX_OPENALL = "Open All";
 GMAIL_INBOX_OPENALLTITLE = "Open All?";
 GMAIL_INBOX_OPENALLCONFIRMATION = "Are you sure you want to open all mail?";
@@ -29,3 +30,4 @@
 GMAIL_OPEN_FORMAT1="GMail: Mail |c00FFFFFF%d|r/|c00FFFFFF%d|r is Cash on Delivery, skipping."
 GMAIL_OPEN_FORMAT2="GMail: Mail |c00FFFFFF%d|r/|c00FFFFFF%d|r has no money or items, skipping."
 GMAIL_OPEN_FORMAT3="GMail: Opening mail |c00FFFFFF%d|r/|c00FFFFFF%d|r: \"|c00FFFFFF%s|r\" from |c00FFFFFF%s|r."
+GMAIL_RETURN_FORMAT="GMail: Returning mail |c00FFFFFF%d|r/|c00FFFFFF%d|r: \"|c00FFFFFF%s|r\" to |c00FFFFFF%s|r."
\ No newline at end of file
