.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Sending information in e-mail from a fillable form

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :ASP.Net

I have created a page for filling information, when anyone fills out the form, the information gets e-mailed to all the recipient's e-mail addresses that are mentioned in the code of the page.

I have written the code which is working fine but when i fill out the information in the form, the information is sent to all the 3 e-mail addresses i mentioned in the code, but all 3 recipients of this information can see other recipient's name and address in the "TO " field of their mailbox.

Is it possible to hide other recipients and only show the e-mail address which will be specific to that recipient ?

Here's my code:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Net.Mail;
using System.Collections.Generic;
using System.Net;

namespace NopSolutions.NopCommerce.Web

    public partial class Careers : BasePage
        protected static readonly MailAddress from = new MailAddress(MessageManager.AdminEmailAddress, MessageManager.AdminEmailDisplayName);
        protected static readonly List<Ma

View Complete Post

More Related Resource Links

Submtting Calendar items with variable date information via InfoPath 2007 form



I've seen several posts regarding submitting to a list using and InfoPath form which I am successfully able to do in limited form. (only passing a basic date value) My environment: MOSS 2007 Enterprise w/SP2, InfoPath 2007, SPD 2007.

I'm basically trying to recreate a calendar form with the same data elements (and some additional ones for a specific business requirement) as the standard calendar newform.aspx form. (start time, end time broken down by date, hour, minute and All day event)

I need the form users to be able to select the date and if it is not an All day event...be able to select the hours and minutes just like on the newform.aspx. (date picker control for date and drop downs for hour and minute selection)

On submit I then need to create the list item with the appropriate data passed via a workflow.

My Start Time has a validation rule to not allow dates prior to the current date (and it can't blank) The End Time has a validation rule to not allow dates prior to what is specified as the Start Time value. (Also can't be blank) When I attempt to include conditonal formatting to hide the hour and minute drop downs if 'All Day Event' is selected I get errors stating the fields can't be blank.

I also can't figure out how to pass the entire date/time values or the All Day Event to the list withou

how to embed image in mail body while sending mail in c#.net uisng Exchange2007_SP1.



I am uisng ExchangeVersion.Exchange2007_SP1 EWS to send mail through my c#.net application. I want to embed image in mail body so tht user can see body message along with image in its inbox mail .currently I am uisng image tag to show image but in the email body its just showing image url instead of image.

Best way to Deploy InfoPath form with connection information and managed code

Hi, Whats the best way to deploy an InfoPath form with connection information and managed code. Is there way I can create a deployment package for this? Thanks in advance, San

Failure sending mail error in asp.net

Hi I have used gmail for sending mail localy which worked fine but when i uploaded the same file on server the "Failure sending mail." error occured.here is the code i have written:            Dim message As New MailMessage            message.From = New MailAddress("xxx@gmail.com")            message.To.Add(New MailAddress("xxx@yahoo.com"))            message.Subject = test mail""            message.Body = "Hi you have got a test mail from me!            Dim client As New SmtpClient            client.Credentials = New System.Net.NetworkCredential("xxx@gmail.com", "xxxxxxx")            client.Port = 587            client.Host = "smtp.gmail.com"            client.EnableSsl = True            client.Send(message)Pl

asp mail form and calculation

Hi All,I have never used asp before and the owner of a site I am working on requires that everything is done in asp. I have a very simple working version in php. Any help I can get would be great, even if I were to be pointed in the right direction.Code:<?php$to = "email@email.com";$subject = "Email from Web Site";$email = $_POST['email'];$jugs= $_POST['txtJugs'];$coolers= $_POST['txtCoolers'];$spent = ($jugs*6 + $coolers*10)*12;$savings = ($spent*30)/100;$msg = "Email: ".$email."\n Jugs: ".$jugs."\n Coolers: ".$coolers."\n Spent: ".$spent."\n Savings: ".$savings;$extra = "From:$email\r\nReply-To:$email\r\n";mail($to,$subject,$msg,$extra);print "We've calculated that you spend approximately $".$spent." annually on drinking water. <b>Quench can save you approximately $".$savings."</b>. Please <a href='../contactus/index.htm'>contact us</a> for more information.";?>

Sending an e-mail with the content of a GridView in asp.net 2.0. problem

Hi experts,  I am Sending an e-mail with the content of a GridView in asp.net 2.0. Everything is working fine , but my problem is that  it is also sending "DELETE" LINKLabel to the email. Is there anyway so that only Content of Gridview will go to email and "Delete" Link will not go. Is it possible ??? Thanks in Advance

problem with sending mail by smtpclient

 hi , I have an aspx  page that sending a mail by smtp client , but it`s not work properly ! and pass an exeption : failur sending mail here is my code :   protected void BTN_Submit_Order_Click(object sender, EventArgs e) { MailMessage MailMsg = new MailMessage("Sales@anahidcorp.com", "test0@anahidcorp.com"); MailMsg.Subject = "?????"; MailMsg.Body = "????"; MailMsg.IsBodyHtml = false; MailMsg.BodyEncoding = System.Text.Encoding.Unicode; MailMsg.SubjectEncoding = System.Text.Encoding.Unicode; MailMsg.CC.Add("test1@anahidcorp.com"); MailMsg.CC.Add("test2@anahidcorp.com"); NetworkCredential cred = new NetworkCredential("Sales@anahidcorp.com", "mypass"); SmtpClient smtp = new SmtpClient("myserver"); smtp.UseDefaultCredentials = false; smtp.EnableSsl = true; smtp.Credentials = cred; try { smtp.Send(MailMsg); } catch ( SmtpException ex) { Response.Redirect("errpage.aspx?err=" +

How to send form result to e-mail from aspx page ?

Hello , I'm stuck with this problem. I have aspx page , (.net 4 , web form ) on this page I have 3 text fields, 3 radio buttons groups, and 6 checkboxes, and button ( submit) . I'm trying to send data to e-mail using button event. The problem which I found that CheckBoxes giving boolean, I want transfer it to Yes or Not. Radio button giving boolean or integer as well. And another problem, I want to send only part which has been answered. empty ( NULL ) field should be ignored. If you can point me in right direction could be cool. What the best way for this? Thank you!

SSIS Send Mail Task - Failure Sending Mail

Dear all, I have switched off the firewall settings on my system and as suggested im entering the minimal information and data to send the mail. but still the Mail Task is failing.. plz suggest.

SSIS Send Mail Task - Failure Sending Mail

Hi Everyone, Hopefully someone out there will have an idea as this is driving me nuts. I've setup a task to email on success/failure and keep receiving the following message when executed: Progress: The SendMail task is initiated. - 0 percent complete[Send Mail Task] Error: An error occurred with the following error message: "Failure sending mail.". Progress: The SendMail task is completed. - 100 percent completeTask Send Mail Task failed When I configure Outlook Express on the same machine with the same settings it works. On the SMTP Connection Manager I have left the default name, tested with both an IP address and Server Name, and no authentication or SSL. On the Send Mail Task, it uses the above connection. The To: , From: , Subject  fields are populated. Message SourceType is DirectInput, MessageSource is Test, Priority is Normal and no attachments or expressions etc. Nothing useful is logged in the Event Viewer even with full logging turned on. Any suggestions appreciated, Thanks.

Sending a Mail Message to Multiple Addresses Using System.Net.Mail

 VWD 2008 Express.  Visual Basic. I use the following routine (XXXXX have replaced sensitive data) to try to send an email message to mutiple email addresses.  It only sends to the first email address in the comma-delimited list.  How can I send the message to multiple email addresses?  Thanks for the help. Protected Sub SendButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SendButton.Click 'Send the message to all users who have emails. Dim smtpClient As SmtpClient = New SmtpClient() Dim message As MailMessage = New MailMessage() Dim Success As Boolean, I As Integer, strTO As String = "" Try 'Gather all user email addresses Dim strSQL = "SELECT EMail from aspnet_membership where Email<>''" Dim MyDataset As DataSet = GetDataSet(strSQL, Success) I = 0 For Each dr As DataRow In MyDataset.Tables(0).Rows If I = MyDataset.Tables(0).Rows.Count - 1 Then strTO = strTO + dr("Email") Else strTO = strTO + dr("Email") + "," End If I = I + 1 Next Dim toAddress As New MailAddress(strTO, "To All Users") 'Ga

Sending mail to Faxnumber - Urgent

Hello Everyone i have been trying to resolve issue since few days but no luck I am trying to send an email to a faxnumber. I am not using as FAXCOMLib  because we don't have a modem or fax line attached to our server. I am using GFI fax maker where i am sending email where it converts email to fax number and send fax. When i use CDO.Message and send mail to a regular email its sends it with no issues but when i use faxnumber@faxmaker.com it doesn't send the mail instead creates  error "Delivery to the following recipients failed" in inetput\mailroot\badmail   When i spoke to my N/w persom he says i should put square bracketts [faxnumber@faxmaker.com] and then send it because then Gfifaxmaker understands that as fax and sends fax Can please someone help me how to put square bracketts without outlook or SMTP server validating the address and send it Please someone hlep Appreicate your'e time and help Thank you very much        

'System.Net.Mail.SmtpException: Failure sending mail.

'System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.   at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)   at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)   at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)   at System.Net.Mail.SmtpReplyReader.ReadLine()   at System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response)   at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)   at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)   at System.Net.Mail.SmtpClient.Send(MailMessage message)   --- End of inner exception stack trace ---   at System.Net.Mail.SmtpClient.Send(MailMessage message)   at crmpark.bemail.sendemail(String toemail, String frmemail, String bcc, String cc, String strattach, String Subject, String bmessage) in    getting the above error when sending mail from asp.net 2.0

Sending email System.net.mail


Ok here's my problem. I have a contact page with a txtbox for users name, email and message for users to contact me.  When I send the message it goes through, but the senders email is always my email. Even though i have set it to the txtEmail.Text property. So when I reply, it sends me an email. What am I not seeing that I messed up. Also this is running from VS 2005.

                 protected void btnSubmit_Click1(object sender, ImageClickEventArgs e)

                 const string toAddress = "myemail@gmail.com";
                    MailAddress from = new MailAddress(txtEmail.Text, txtName.Text);
			        MailAddress to = new MailAddress(toAddress, "Admin");
			        MailMessage message = new MailMessage(from, to);

			        // set properties
			        message.Subject = txtName.Text + " has sent you an email!";
			        message.Body = txtMessage.Text;
                                message.IsBodyHtml = false;

			        //create smtp object
			        SmtpClient client = new SmtpClient();
                               client.EnableSsl = true;

                    catch(Exception ex)

mail sending error


I am getting the following error while trying to send email using System.Net.Mail

Mailbox unavailable. The server response was: Access denied - Invalid HELO name (See RFC2821

i have tried the basic mail sending method but it gives the above error. pls find belwo code used

SmtpClient SmtpServer = new SmtpClient("");
        SmtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;
        System.Net.Mail.MailMessage Mailer = new System.Net.Mail.MailMessage();

                    SmtpClient smtpClient = new SmtpClient();                 
                    Mailer.From = new MailAddress("");
                    Mailer.Subject = "";

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend