[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 869
  • Last Modified:

Forward Email to a Friend

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
cmaorg
Asked:
cmaorg
  • 4
  • 3
  • 2
  • +2
1 Solution
 
Harisha M GCommented:
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
 
cmaorgAuthor Commented:
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
 
Harisha M GCommented:
Are you telling that you want to create your own page that can send the emails ?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Harisha M GCommented:
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
 
cmaorgAuthor Commented:
Yes I would like to set up my own page.
0
 
ValidorCommented:
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
 
ValidorCommented:
I should probably add, just to be thorough, that you can also use MAPI or IMAP4 to send email, not just SMTP.
0
 
PaulBurksCommented:
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
 
cmaorgAuthor Commented:
The email will be changing everytime it is sent out
0
 
tomvergoteCommented:
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
 
PaulBurksCommented:

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
 
cmaorgAuthor Commented:
Thanks so much for everyone's help!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now