Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Forward Email to a Friend

Posted on 2004-09-30
12
Medium Priority
?
855 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Introduction to Processes

636 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