Solved

Forward Email to a Friend

Posted on 2004-09-30
12
775 Views
Last Modified: 2008-03-17
I wonder if you could help me. I am looking for a script that will allow people who receive my email to forward it to their friends by clicking on a link. The link would take them to a page where their email address would automatically populate and they would be able to add the email addresses of their friends. Their friends would then receive the same email in HTML not a link. I can either use ASP or Coldfusion but I am a newbie and was wondering if you new of somewhere I can learn how to do this or if any of you have any scripts that already do this that I can modify.

Any help would be greately appreciated.

thanks in advance

cmaorg
0
Comment
Question by:cmaorg
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 37

Expert Comment

by:Harisha M G
ID: 12192736
It depends on the server and the mail program they are using.
You will have give a link for each of the server that your friend are using.

Bye
0
 

Author Comment

by:cmaorg
ID: 12192800
Maybe I didn't explain myself correctly. Once the person receives the email he/she clicks on a "forward this email to a friend" link and they will be taken to a page where they can add the emails of their friends. Once they click on submit then their friends would receive the same email in HTML format.
0
 
LVL 37

Expert Comment

by:Harisha M G
ID: 12193032
Are you telling that you want to create your own page that can send the emails ?
0
 
LVL 37

Expert Comment

by:Harisha M G
ID: 12193167
If your friends use Yahoo!, the link that will take them to the page where they can forward looks likes this:

http://us.f204.mail.yahoo.com/ym/Compose?box=Inbox&Mid=3235_58643_4596_1098_502_0_325_1135_2893509558&inc=&Search=&YY=27501&order=down&sort=date&pos=0&view=a&head=b


Suppose you have a mail and you are logged in to Yahoo! then if you give this url it will redirect you to a page where you can compose (forward). But if you are using something other like Rediffmail or Hotmail the url will be different
0
 

Author Comment

by:cmaorg
ID: 12193312
Yes I would like to set up my own page.
0
 
LVL 3

Expert Comment

by:Validor
ID: 12194675
I believe that your page will also have to RECEIVE the emails in order to send them unless there is another port for the email to be downloaded, such as a POP3 server.  There must be some way for the server to get its hands on the email that it is forwarding.  Otherwise, you must tell the server that DOES hold the mail to forward it for you, and that (as the others have pointed out) depends on the mail server / service.

If you use ASP, you can write an SMTP client and POP3 client as COM objects (I'm sure there are already some out there if you look).  This would allow you to read a regular pop3 email account inside the web server and display the "mailbox" to the user.  Then, when the user forwards the mail, you would simply download the email from the pop3 server and then forward it through the SMTP server.  You would maintain the friend's email addresses in a database on the web server.

If you use ColdFusion, you can surely do the same thing, but I'm not sure what programming support it has beyond its own script language.  If it can use COM libraries, .NET assemblies or legacy Win32 DLLs, you should have no problem doing the same thing in ColdFusion.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 3

Expert Comment

by:Validor
ID: 12194698
I should probably add, just to be thorough, that you can also use MAPI or IMAP4 to send email, not just SMTP.
0
 
LVL 1

Expert Comment

by:PaulBurks
ID: 12194787
I think I have a script that will do what you are describing, but I need to understand this. Is the email (that you are originally sending) a one-of-a-kind type letter, a series of standard letters, or is it something that will be changing every time you send it out?
0
 

Author Comment

by:cmaorg
ID: 12199569
The email will be changing everytime it is sent out
0
 
LVL 8

Expert Comment

by:tomvergote
ID: 12201465
A) create a script for yourself that allows you to send an HTML mail, and stores the mail body and subject and stuff in a database. (if you need it you can bulk mail to a list of adresses from the db etc)
B) Make sure there is a link in the page "forward to friend" that has a link like http://www.mysite.com/forwardscript?id=mailid where mailid is a unique id by which you can find your mail in your database
C) make sure the forwardscript fetches te mail out of the DB from the id in the querystring, whip up a form that posts to a script which does some mailing again.
0
 
LVL 1

Accepted Solution

by:
PaulBurks earned 500 total points
ID: 12202451

Here is how I have accomplished this in the past. I whipped this up for an example so it has not been debugged but the code should work fine. I have included the HTML for a sample letter and the code on an ASP page you'll need to create. This will actually allow viral propigation. When the friend receives the letter THEY can send it out and so on.

Assume this is your letter to joe@anydomain.com with the Subject "Joke of the Day". Here is the HTML code for the letter itself:

<HTML>
<BODY>
Dear Joe,
<p>
The joke of the day is a blonde joke.
<p>
The blonde swimmer worked really hard, and finally, not only made it to the Olympics, but won the gold medal. She was so proud of it, she immediately took it home...<br>
.<br>
.<br>
.<br>
and had it bronzed!
<p>
<p>
<FORM METHOD="Post" Action="http://www.mysite.com/myform.asp" >
      <INPUT Type="Hidden" Name="Subject" Value="Joke of the Day">
      
      <INPUT Type="Hidden" Name="BodyMessage" Value="<HTML><BODY>Dear Joe,<p>The joke of the day is a blonde joke.<p>The blonde swimmer worked really hard, and finally, not only made it to the Olympics, but won the gold medal. She was so proud of it, she immediately took it home...<br>.<br>.<br>.<br>and had it bronzed!<p><p>"
      
      <INPUT Type="Hidden" Name="EMail" Value="joe@anydomain.com">
      <INPUT Type="Hidden" Name="Flag" Value="1">
      <INPUT Type="Submit" Name="Submit" Value="Click here to send to your friends.">
</FORM>
</BODY>
</HTML>

Note: If there are any quotation marks (") in your Subject or Body text, be sure that you double them ("").




**************  The ASP script******************




Here is the "myform.asp" asp script at http://www.mysite.com/myform.asp :

<% Option Explicit %>

<HTML>
<HEAD><TITLE>Send a Joke to a Friend!</TITLE></HEAD>

<%
Dim EMail
Dim Subject
Dim BodyMessage
Dim Flag
Dim FriendName
Dim FriendEMail
Dim EMailMessage

EMail = Request.Form("EMail")
Subject = Request.Form("Subject")
BodyMessage = Request.Form("BodyMessage")
Flag = Request.Form("Flag")
FriendName = Request.Form("FriendName")
FriendEMail = Request.Form("FriendEMail")

If Flag = "2" Then
      EMail = FriendEMail

      Set EmailMessage = Server.CreateObject("CDO.Message")
      With EmailMessage
            .From = EMail & " <Joker@mysite.com>"
            .To = FriendEMail
            .Subject = Subject
            .HTMLBody = BodyMessage & "<INPUT Type=""Hidden"" Name=""EMail"" Value="" &  FriendEMail & ""><INPUT Type=""Hidden"" Name=""Flag"" Value=""1""><INPUT Type=""Submit"" Name=""Submit"" Value=""Click here to send to your friends.""></FORM></BODY></HTML>"


            .Send
      End With
      Set EMailMessage = Nothing
End If      

%>

<BODY>
<% Response.Write BodyMessage %>
<br><br>
<% If Flag = "1" Then
      Response.Write BodyMessage
      Response.Write "<br><br>"
      Response.Write "To send this joke to a friend, please enter their name and email address in the boxes below:"
      <br><br> %>
      <FORM Method="Post" Action = "myform.asp">
            <Input Type="Text" Name="FriendName">
            <br>
            <Input Type="Text" Name="FriendEMail">
            <Input Type="Hidden" Name="Flag" Value="2">
            <Input Type="Hidden" Name="Subject" Value="<% = Subject %>">
            <Input Type="Hidden" Name="EMail" Value="<% = EMail %>">
            <Input Type="Hidden" Name="BodyMessage" Value="<% = BodyMessage %>">
            <Input type="Submit" Value="Send Now"
      </FORM>
<% Else
      Response.Write "Message Sent!<br><br>"
      Response.Write "To send this joke to another friend, please enter their name and email address in the boxes below:"
      <br><br> %>
      <FORM Method="Post" Action = "myform.asp">
            <Input Type="Text" Name="FriendName">
            <br>
            <Input Type="Text" Name="FriendEMail">
            <Input Type="Hidden" Name="Flag" Value="2">
            <Input Type="Hidden" Name="Subject" Value="<% = Subject %>">
            <Input Type="Hidden" Name="EMail" Value="<% = EMail %>">
            <Input Type="Hidden" Name="BodyMessage" Value="<% = BodyMessage %>">
            <Input type="Submit" Value="Send Now"
      </FORM>
<% End If %>      
      
</BODY>
</HTML>
0
 

Author Comment

by:cmaorg
ID: 12230810
Thanks so much for everyone's help!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now