Complex emailing from webpage

Hi everyone,
I have posted this question in several forums but have had
very littel response. I would greatly appreciate someone letting me
know which direction I should go in to achieve this task.
I want to have a list of contactable people on my webpage,
and for the user to have the option to contact as many or as few as
they like in one go by selecting a checkbox next to their name.
When you have selected the checkboxes, you click "send" and an
automatic email is generated and sent to the people selected.
Pretty simple - but I can't work it out. Once I have worked out
this bit there will be more complex issues to deal with, but for
tge time being I want to have:
1. An automatic email that says - "This is my automatic
email"
2. Users to be able to select froma list of 10 or so
contacts, by ticking checkboxes, and then clicking "send"
3. The automoated email is sent to the selected people.
Please please help me with this, I will learn whatever I have
to learn - but simply do not know where to start!
Thank you
Nathan

NJFuller wrote:
> Thanks again. I have been studying at Killerphp.com -
would be interested to
> know what you think of them.
It's very difficult for me to comment on killerphp.com. I
have been
there before and looked at one of the videos, but I found the
explanation so slow, I was falling asleep. The problem is
that I know
the stuff that is being taught. For someone who's a complete
beginner,
it might be just the right speed. I've just looked at another
video, and
the content was accurate. So, if his teaching style suits
you, it might
be OK.
Without sitting through the whole course, though, it's
impossible to
know whether it pays sufficient attention to security. A
major problem
with a lot of tutorials and books is that they concentrate on
the basic
mechanics of form processing, but pay little or no attention
to
server-side validation, which is essential to guard your site
against
malicious attacks.
In the code I created for you (and which Gary improved), the
user input
is checked to make sure only expected values are inserted
into the
$toAddresses variable. Without those checks, a malicious
attacker could
turn your form into a spam relay.
All user input needs to be checked to make sure it doesn't
contain
anything unexpected. Inexperienced developers often rely on
JavaScript
to do all the checking. That might help the genuine user, but
it's an
open invitation to an attacker. All the attacker needs to do
is turn off
JavaScript, and your form is an open window: all the checks
are by-passed.
> Could you give me an examples of the mail command in
this particular case, once
> I have an overview of the whole process I should be able
to use my noggin to
> work out the rest :)
The PHP mail() command is very simple. It takes a minimum of
three
arguments: the address(es) the mail is being sent to, the
subject line,
and the body of the message.
After processing the addresses as shown before, you build the
body of
the message by creating a single variable that gathers the
information
from the other fields. Let's say your form has three fields
called
"name", "email", and "comments", you could build the message
like this:
$message = "Name: {$_POST['name']}\n\n";
$message .= "Email: {$_POST['email']}\n\n";
$message .= "Comments: {$_POST['comments']}";
You then send the message like this:
$sent = mail($toAddresses, 'Comments from the web page',
$message);
if ($sent) {
echo 'Your message has been sent';
} else {
echo 'Sorry, there was a problem with your message';
I haven't conducted any checks on the content of the three
fields,
because they're simply being put into the body of the
message. However,
in normal circumstances, you should perform some checks. For
example, a
lot of tutorials show how to pass the user's email address to
the mail()
function as a fourth argument, so that you can send a reply
to the user
just by clicking reply in your email program. This leaves a
gaping
security hole that attackers use to turn your site into a
spam relay.
PHP is relatively easy, but it's also easy to make serious
mistakes that
will cause big headaches down the line.
David Powers
Adobe Community Expert, Dreamweaver
http://foundationphp.com

Similar Messages

  • How to Send HTML Email from Webpage?

    Hi Everyone!
    I'm Looking to Send Emails with an Option to Send Text Format (from textfile on Webserver, ex. textfile.txt) or HTML Format (from webpage on Web Server, example: test.html).
    I will include My Current Code at the end of this Q.
    What Code will I need to use to create the Option, extract the data from the .txt file Or HTML File, and send the Content in the Body of the E-mail?
    Also, how can I send the e-mails (both HTML and/or Text Format) to Multiple Recipients by adding the names into the '$email' textbox on the current form?
    Thanks in Advance!

    Which class are u using for the same purpose ?

  • I can't open pdf particularly from hyperlinks in emails and webpages

    I have downloaded the latest version of reader several times now and this has not fixed the problem.  I can open some pdf documents but not all and it only started when I upgraded to the latest version. I small "x" appears in the top left corner of the page when I try to open some documents particularly from webpages or hyperlinks in emails.  I can sometimes get around the issue by right clicking and saving to the desktop but this is not always possible.  Any suggestions on how to fix this?

    Assuming that you are on Windows with IE10 / IE11: http://support.microsoft.com/kb/2716529

  • Send information from webpage to an email

    i am new to Java & Programming , i am creating a webpage & i Need to send information from webpage to an email without using the database,
    please help me out

    ??? You don't use a database to send emails, you use the JavaMail api.
    http://java.sun.com/products/javamail/

  • Cannot send email from my mobileme on iphone 3g

    Suddenly coudn't access my mobileme email account. So I changed my password; and since I couldn't send email from my iphone 3G
    I can send/receive emails from icloud webpage or Thunderbird.
    Any clues?

    outgoing mail server
    SMTP - Yahoo! SMTP Server
    primary server
    Yahoo! SMTP server - ON
    server port 465
    That's what I have for my yahoo account.

  • Sending an email from a servlet

    Hi Guys,
    Im trying to send an email from a servlet. I am using the following code:
    IMPORTING LIBRARIES
    import java.util.*;
    import java.io.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    //importing JDBC
    import java.sql.*;
    //email
    import java.net.*;
    import java.text.*; // Used for date formatting.
    BEGIN CLASS
    public class Email3 extends HttpServlet
         private Socket smtpSocket = null;
         private DataOutputStream os = null;
         private DataInputStream is = null;
    public void doPost (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    PrintWriter out = res.getWriter();
    OUTPUT TAGS FOR WEBPAGE
         out.println("<html>");
    out.println("<head>");
    out.println("<title>FYP</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<center>");
    send email
              //Date dDate = new Date();
              //DateFormat dFormat = _
         //DateFormat.getDateInstance(DateFormat.FULL,Locale.US);
         String m_sHostName="localhost";
         int m_iPort=25;
              try
              { // Open port to server
                   smtpSocket = new Socket(m_sHostName, m_iPort);
                   os = new DataOutputStream(smtpSocket.getOutputStream());
                   is = new DataInputStream(smtpSocket.getInputStream());
                   if(smtpSocket != null && os != null && is != null)
                   { // Connection was made.  Socket is ready for use.
                        out.println("Connection was made. Socket is ready for use.");
                        //[ Code to send email will be placed in here. ]
                        try
                             {   os.writeBytes("HELLO\r\n");
                             // You will add the email address that the server
                             // you are using know you as.
                             os.writeBytes("MAIL From: <[email protected]>\r\n");
                             // Who the email is going to.
                             os.writeBytes("RCPT To: <[email protected]>\r\n");
                             //IF you want to send a CC then you will have to add this
                             os.writeBytes("RCPT Cc: <[email protected]>\r\n");
                             // Now we are ready to add the message and the
                             // header of the email to be sent out.
                             os.writeBytes("DATA\r\n");
                             os.writeBytes("X-Mailer: Via Java\r\n");
                             //os.writeBytes("DATE: " + dFormat.format(dDate) + "\r\n");
                             os.writeBytes("From: Me <[email protected]>\r\n");
                             os.writeBytes("To: YOU <[email protected]>\r\n");
                             //Again if you want to send a CC then add this.
                             os.writeBytes("Cc: CCDUDE <[email protected]>\r\n");
                             //Here you can now add a BCC to the message as well
                             //os.writeBytes("RCPT Bcc: BCCDude<[email protected]>\r\n");
                             String sMessage = "Your subjectline.";
                             os.writeBytes("Subject: Your subjectline here\r\n");
                             os.writeBytes(sMessage + "\r\n");
                             os.writeBytes("\r\n.\r\n");
                             os.writeBytes("QUIT\r\n");
                             // Now send the email off and check the server reply.
                             // Was an OK is reached you are complete.
                             String responseline;
                             while((responseline = is.readLine())!=null)
                             {  // System.out.println(responseline);
                             out.println("responseline= "+responseline+"<br>");
                             if(responseline.indexOf("Ok") != -1)
                                  //out.println("responseline"+responseline);
                             break;
                             catch(Exception e)
                             {  System.out.println("Cannot send email as an error occurred.");
                                  out.println("Cannot send email as an error occurred.");
              catch(Exception e)
              { System.out.println("Host " + m_sHostName + "unknown"); }
              out.println("</center>");
              out.println("</body>");
              out.println("</html>");
              out.close();
    }//end class
    it compiles fine, the connection was made ok but im not receiving the email. When the email is sent off the server reply does not seem to be Ok, as the print statement i tried there is not being executed. When i print the content of my responseline= variable before the if statement i get the following:
    Connection was made. Socket is ready for use. responseline= 220 centaur.elec.qmul.ac.uk ESMTP Exim 3.16 #2 Thu, 09 Jan 2003 15:54:34 +0000
    responseline= 500 Command unrecognized
    responseline= 250 is syntactically correct
    responseline= 550 relaying to prohibited by administrator
    responseline= 500 Command unrecognized
    responseline= 503 No recipient(s).
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 221 Closing connection. Good bye.
    Can anyone help?
    Is there an easier way to send an email from a servlet?
    Thanks
    tzaf

    It's not a matter of "easier way" to send mail from servlet...you are missing a crucial element in your code: authorization to send mail. You need something like this (some of which you have already so note what is different):
            Properties properties = new Properties();
            properties.put("mail.smtp.host", String3 );
            properties.put("mail.smtp.dsn.notify", "SUCCESS" );
            properties.put("mail.smtp.host", "mailservernamegoeshere");
            properties.put("mail.smtp.auth", "true");
            MyAuthenticator auth = new MyAuthenticator();
            auth.setUser("user whos account you want to use goes here");
            auth.setPassword("user password goes here");
            Session session = Session.getDefaultInstance( properties,auth );Here is the auth class:
    class MyAuthenticator extends Authenticator {
       protected String m_strUser     = null;
       protected String m_strPassword = null;
       protected PasswordAuthentication getPasswordAuthentication()  {
          return new PasswordAuthentication(m_strUser,m_strPassword);
       public void setUser(String strUser)  {
          m_strUser = strUser;
       public void setPassword(String strPassword)  {
          m_strPassword = strPassword;

  • TS3276 I need feedback for the following issue. When I send email from this 27 inch iMac, the computer adds a string of characters in vertical column that represents the QWERTY key board, all alpha numeric characters are included. Yahoo mail, issue only o

    Restating my issue / question...
    When I send email from this iMac, there is a string of characters assigned. The characters are all the "alpha numeric" characters on the QWERTY key board. This only occurs when email is sent from this iMac. The issue does not manifest when using any other lap top or computer.
    Hence, I have ruled out the issue is a yahoo mail matter.
    Again, I can access the Yahoo mail account form multiple devices and send email without unintended assignment of character strings, but when I send wmail using this iMac, the issue happens everytime.
    Characters are stacked verticaly in a column. It looks as if all characters (except function keys) are included in the string.
    Any ideas?
    GMc

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The following procedure will help identify which such modifications you've installed. Don’t be alarmed by the complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac. 
    These steps are to be taken while booted in “normal” mode, not in safe mode. If you’re now running in safe mode, reboot as usual before continuing. 
    Below are instructions to enter some UNIX shell commands. The commands are harmless, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. 
    Some of the commands will line-wrap or scroll in your browser, but each one is really just a single line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it. The headings “Step 1” and so on are not part of the commands. 
    Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. The other steps should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply. 
    Launch the Terminal application in any of the following ways: 
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) 
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. 
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid. 
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign. 
    Step 1 
    Triple-click the line of text below to select it:
    kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}' | open -f -a TextEdit 
    Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). A TextEdit window will open with the output of the command. Post the contents of that window, if any — the text, please, not a screenshot. You can then close the TextEdit window. The title of the window doesn't matter, and you don't need to post that. No typing is involved in this step.
    Step 2 
    Repeat with this line:
    { sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix)|org\.(amav|apac|cups|isc|ntp|postf|x)/{print $3}'; sudo defaults read com.apple.loginwindow LoginHook; } | open -f -a TextEdit 
    This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. 
    Note: If you don’t have a login password, you’ll need to set one before taking this step. If that’s not possible, skip to the next step. 
    Step 3
    launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)/{print $3}' | open -f -a TextEdit 
    Step 4
    ls -1A /e*/mach* {,/}L*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta}* L*/Fonts 2> /dev/null | open -f -a TextEdit  
    Important: If you formerly synchronized with a MobileMe account, your me.com email address may appear in the output of the above command. If so, anonymize it before posting. 
    Step 5
    osascript -e 'tell application "System Events" to get name of every login item' | open -f -a TextEdit 
    Remember, steps 1-5 are all copy-and-paste — no typing, except your password. Also remember to post the output. 
    You can then quit Terminal.

  • How to copy/paste texts/images from webpages in iBooks Author?

    Hi,
    I want to copy/paste text/image contents from webpages with iBooks Author, somehow images can't be copied, only texts can be copied with copy/paste editing. Wonder if there are any ways to include images with simple copy/paste?
    Tried to search iBooks Author help, could not find answers. Please help.
    Thanks

    Perhaps the people who spent a lot of time and money to produce the websites.....and who own copyright ...don't want anybody using their work without payment or credits. Have you contacted the websites owners to ask permission? 
    IF any person(s)  use anything from websites without permission apart from being to lazy to email to request permission....could face a legal action if and when the sites owners fins out. 
    There is another her misconception that "free" websites and content on "social media" such as the dreaded FaceBook....can be used without consequence. Almost all "free" websites are common licence material - which requires permission and those who give permission do so only for personal or none profit reproduction.
    i Use a blocking script on my websites which apart from preventing a right click...those who try are whisked off  my website to the the UK copyright website page which explains my rights! 
    You may wish to check out your iBooks contract with Apple and read their warnings on use of others copyright material. 
    You could ..and should contact the websites...explain what you want to use and why....and ask them if they can supply media.

  • Firefox doesn't allow me to email a webpage by right-clicking anymore - Why?

    I used to be able to right-click on a webpage, and email the page. Then, something changed, and when I right-clicked, that option was not immediately available. Instead, I had to right-click, hover over a main category that then offered me two options, once of which was emailing the webpage through Yahoo. When I did that, the email would fill with the link, but a lot of junk about Yahoo, too.
    Now, when I right-click just two weeks later, option is completely gone. So, now, I cannot email a webpage just be right-clicking. I have to copy the link, open an email, and paste the link. What happened, and can I get back?

    hello cera78, mozilla does clean up its user interface from time to time. user interface studies have shown that this context menu entry is only used by <1% of the users.
    if you've liked the functionality you could use an addon to recover it: https://addons.mozilla.org/firefox/addon/send-link-in-context-menu/

  • What is the best way to email a webpage?

    This concerns sending (emailing) a webpage to someone.
    • Amazon.com has a feature that allows one to page through a book that you may be considering purchasing.
    • I want to email some of the text from a page in one such book to someone else.
    • Although the page is viewable to me I have not found a way to copy it (to then paste it into an email), nor can its URL be sent as a unique (and openable) locator address.
    What is the best way for me to email the text? (I tried saving it via 'Print as Compressed PDF') but the result was not viewable even to me, so it won't be to my correspondent either).
    While I'm at it, what is considered to be the best way to view PDF's on the Mac -- the built-in PDF viewer seems rather limited. (Maybe that's why I couldn't view the saved PDF file of the webpage -- should I download the Mac version of Adobe Reader?)
    Many thanks.

    It doesn't work...
    It works for me in the Safari 3 beta. I'm actually surprised if the beta does much that's different with the "Mail Contents of This Page" command than Safari 2....
    I tried The Yiddish Policemen's Union: A Novel on Amazon (first searchable book I found quickly clicking in the Books section ). I just emailed myself a page - the first search result for the word "something." The email I received is perfect - the entire page from the book plus the Amazon page around it, all perfectly formatted.
    I suppose if you don't use Mail.app for your email program that might not work as well. Are you using Mail or another email program?

  • Sending email from 2 SMTP servers

    Hi Experts,
    We have users from different domains in 1 client. Emails are send out from different domains. We directed SCOT to 1 of the SMTP server, and the email administrator will setup relays from this SMTP server to other SMTP servers. But now, some are saying that relays are not secure and that it should be removed. Hence, we are trying to find alternative.
    How am I able to add another SMTP node in SCOT so that email from different domains are directed to different SMTP servers directly?
    Thanks,
    TM

    You will not find anything from SAP to support your claim.
    SAP designed its system to be able to send emails to a single SMTP node. That is a fact and it is logical because SAP Netweaver is not a dedicated mail software.
    If you have more complex needs, you have to find a workaround.
    In my company, my solution was to install an SMTP relay software managed by the SAP administration team.
    Therefore we can set our own routing rules for incoming or outgoing mails from our SAP systems (ECC, SRM, CRM, etc...)
    This SMTP relay can then send or receive emails from the company SMTP official servers.
    Regards,
    Olivier

  • Email a webpage?

    How do you email a webpage from the Z10?

    rje wrote:
    Can the phone keypad tones be disabled?
    Yes, put the device on SILENT and the dial pad is silent.
    From the homescreen, swipe down from the top bezel > touch the notifications icon to swap from normal to silent.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Calling an Executable that Requires DOS from Webpage

    Could anyone helpout with this. I am trying to call an executable from a webpage. The purpose is to collect some data, store them in some strings then based on that data call the DOS executable and fill in the switches. For example the executable is clemail.exe and the switches are -to [person to] -from [person from] -subject [subjectline] etc... The DOS line looks like this:
    clemail.exe -to [email protected] -from [email protected] -subject email sender -body This exe enables you to send an email from the DOS command line.
    Any suggestion would be appreciated.
    Thanks,
    George

    Could anyone helpout with this. I am trying to call an executable from a webpage. The purpose is to collect some data, store them in some strings then based on that data call the DOS executable and fill in the switches. For example the executable is clemail.exe and the switches are -to [person to] -from [person from] -subject [subjectline] etc... The DOS line looks like this:
    clemail.exe -to [email protected] -from [email protected] -subject email sender -body This exe enables you to send an email from the DOS command line.
    Any suggestion would be appreciated.
    Thanks,
    George
    U can do that using
    Runtime.getRuntime().exec ("clemail.exe -to [email protected] -from [email protected] -subject email sender -body ");
    remember to put the clemail in path or give the entire path.

  • VersaMail on TX crashes / resets on email from one sender

    Hi;  My VersaMail crashes and soft reboots my TX when I attempt to open or delete emails from one particular sender.  VersaMail works fine with email from other senders.  The only way I have found to get rid of this person's emails is to delete my email account from the TX and recreate a new account.  An ideal solution will be a way to delete corrupt emails from VersaMail without having to delete the entire account.  Other than requesting this person never send me an email again, I will appreciate any recommendations.  Thanks.
    Post relates to: Palm TX

    Hello!
    Since this issue is happening from specifc sources, safe to say its content in the e-mail the PDA cannot read.  Couple basic things to cover:
    1.  Make sure to have at least 4mb free space on PDA.
    2.  Try another mail provider like gmail to fwd these e-mails there and have the PDA retrieve them via that acct to see how that fairs.
    Afterwards Id like to know:
    1.  How big are these e-mails?
    2.  Do they have attachments?  If so what are they and how big are they?
    3.  In the Versamail preferences under Delivery Options, are you:
    a.  Getting the entire message?
    b.  Auto downloading attachments checked?
    c.  Maximun message size still at 5kb or has that been increased?
    d.  Message format in HTML or Text?
    4.  These e-mails adds?
    5.  These e-mails loaded with alot of pictures and/or other flashy content?
    For troubleshooting, Id like to have the Message format changed from HTML to Text to make those e-mail less complex to see how that fairs.  Next thing is make sure your only getting the e-mail header first rather the whole e-mail in preferences.  This could save you from replication and sudden loss of memory on PDA.  Keep me posted.
    Post relates to: Treo 650 (Unlocked GSM)

  • Unable to send web content emails from mail as web page since upgrading to the new OS X 10.9

    I am no longer able to send web content emails from mail as web page. The images / layout no longer transmit. This started when I upgraded to the new OS X 10.9. The emails appear correctly in the orginal message prior to sending but once they are sent all the images and layout are removed. The sent message folder shows the emails in the changed versions vs what the draft showed prior to sending. If the webpage is only an image my final sent message will only show an empty box with an question mark.

    Hold down the option key and select
     ▹ System Information...
    from the menu bar. In the window that opens, select
    Hardware ▹ USB
    from the list on the left. On the right you should now see a list of all connected USB devices, as well as some built-in components. Is the device shown?

Maybe you are looking for

  • How do i create a non-scored multiple answer question?

    Hi, I've tried to figure out the best way to do this in Captivate 7, but can't find an answer. I hope you can help me out as I'm stuck I need to create a question with 10 possible answers. They are opinions only---not correct or incorrect. Kind of li

  • Can a family mobile sim card can fit in a iphone 4s

    can a family mobile sim card work in a iphone 4s

  • App Error 523

    Hey Folks, Im in a bit of a bother. 3 weeks ago, i went to goa for a few days off. I had switched off my phone, and when i landed, i turned it on in order to call the hotel. When i did turn it on, i got this white screen which simply said "app error

  • Cannot click in the Search field

    I cannot click in the Search field and perform a search in the Store.

  • SB Audigy 2 zs he

    Hi everyone need some serious hep here please bare with me as it'ss a long story. I left my computer on over for the past three day processing stuff when I awoke there was a little bit o condensation inside my pc so I shut the system down and cleaned