how to generate "reply to" link from "mail to" string in c# - c#

I want reply to link similar to mail to.
I generate email string from c# code and want to put reply to link which replies to current email. Can anyone help to put reply to link in c# code?
for example: to generate mailto link we use mailto:testemail#gmail.com?subject=testsubject.
By clicking on this link, we are able to mail to particular emailid.
Similarly, I want reply to link by clicking on it, user is able to generate email as reply to current email.

Assuming you are showing your user an existing email which they are trying to reply to ? There is no HTML tag that does this.
You haven't said where this email is coming from, but I assume you are showing your user an email or other communication that is generated in your system. If this is the case they you will need to code this up just like any other POST link and pass in the "id" of the email you want to reply to - the result of the POST should be a redirect to an email-like page where you have programmatically filled out much of the email content by quoting it from the original email.
Once the user has filled out this Reply mail page, another HTTP POST back to your server and you can use the .net SMTP capability to construct an actual email and send it from your server. Note that there is no capability of sending such and email from your users mail account, or using their mail client.

Related

How do I download the email I just sent using Graph API?

I am using GraphAPI for sending email. I have a situation where I need to Save a copy of the email sent. I can retrieve the Messages using graph api. How do I identify the email I just sent? When I use the SendEmail endpoint of the Graph api, I get a 200 OK response. How do I identify the email I just sent so I can download that email?
I have tried a number of solutions, adding custom Identifiers and filtering it but none of them worked.
I haven't tried this, but this approach seems it would work: https://learn.microsoft.com/en-us/graph/outlook-immutable-id#immutable-id-with-sending-mail.
Create the message as a draft with Prefer: IdType="ImmutableId" header
Save the returned id
Send the draft
Note that email sending is asynchronous so you might not be able to download the sent email right away. It could take some time to be available.

Pulling recipient email address from a link within an email?

I have a C# Mailkit program that automatically sends emails to an email list. I have a web server with a database filled with email addresses and I want to incorporate an unsubscribe link within my emails. Is there any way of tracking the email address of the person who clicked the link? I essentially just want to remove the email from the database of the person who unsubscribed.
Are there any kind of special links/anything I can do to pull the user's email address after they click the link?
thank you.
"When creating email message with mailkit inside the body create unsubscribe link which contains email in query parameter.Like in my example above. That link needs to point to your web server on specific endpoint which can read email address from that query string and remove it from datsbase. – SlobodanT"
"Don't use encryption for this. Don't pass user information like emails in links. When you send a user an email, store a GUID for that user or email and include it in the unsubscribe link; something like http://example.com/unsubscribe/GUID HERE. Your unsubscribe page looks up the email or user and unsubscribes them. – Dour High Arch "

Forwarding/Redirecting email using asp.net C#

I am working on an asp.net job website. each company can post a vacancy and email address to contact to. I have found that competitors are copying the vacancies and email address from my site. How can I get rid of this ? What if i show a dummy email address on vacancy but when user copies this email address and sends email, it goes to actual vacancy email ? Is this possible using asp.net ?
Well, if your purpose is only to hide the mail id, why show it in the first place?
You could easily provide a mail link/button, and send an email using .net mail functions.
The mail address is available in code behind, but you don't write it to the page. If its not in the response, they can't copy it.
If the information is on your website, I don't think you can stop other people from copying the links.
You could add a button to a form where the user can add details to a set of fields which you then send on to the advertising company. This is how lots of job websites work.

Identify reply mail of which mail category using internet header info

i am working on an application which send email with custom internet header info in it which is used to identify mail type it has been sent.
for example, if i sending for option A it will be my custom tag with value 1 or if i send for option B it will be my custom tag with value 2.
if the customer reply or forward to that mail, i need to identify for which mail type is replied or forwarded (i.e., it is for option A or Option B). so i need to carry the custom internet header info in reply or forward mail also. any option available to carry the custom internet header in reply or forward mail or is there any alternative approach to do this
I assume that you have already developed the part where customer can select the options.
Reading mime headers you can try this: Get email Headers from an Outlook MailItem

Getting Email Address of the receiver dynamically in the Email body

The Main Agenda behind this question is that I want to replace a dynamic holder in my Email body with the email address who has received the mail
We would be using the standard procedure using asp.net, i.e. Making an Email Body then by using the smtp.send(), would be sending the mail to the concerned email address. But I would like to have a place holder in my email body (e.g. Thanks for reading the mail, xxx#yyy.com), such that the xxx#yyy.com gets replaced by the one who is openeing the mail.
Now here comes the interesting part..... the user that i sent the mail (e.g xxx#yyy.com) if forwards the mail to some other email address (e.g abc#zzz.com), then when abc#zzz.com opens the mail he would see "Thanks for reading the mail, abc#zzz.com".
Is it possible in the first place ?
I don't believe what you're asking is possible. When you generate and send the email, the email body is composed on the server side, hence you have full control over it. Once the user has it in their email box, you no longer can change the content of that email.
An Email's content can't change - that kind of behavior would be similar to you running your code on the client's machine without their permission, i.e. a virus and is generally frowned upon.

Categories

Resources