Search Results

Search found 133 results on 6 pages for 'mailmessage'.

Page 5/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • sending email on local machine is not working.

    - by haansi
    I am using my gmail's email account to send emails in asp.net website. It works fine on hosting server but it donot works if I try to sent email on loclserver. Please guide me what I should do to make it sending emails even on localserver ? Do I need to install some smtp server on my local machine ? I have not installed any smtp server on my machine. How and where from I can get smtp server and kindly also guide how I can do its setting to use on local machine. Thnaks Here is my Code public string SendEmail(Email email) { string errmsg = null; if (dt != null) { try { dt = systemrep.GetSystemInfo(); dr = dt.Rows[0]; From = dr["nm_EmailFrom"].ToString(); SMTP = dr["nm_SMTP"].ToString(); Port = dr["amt_Port"].ToString(); EmailId = dr["nm_emailUserId"].ToString(); EmailPassword = dr["nm_emailPassword"].ToString(); DefaultCredations = Convert.ToBoolean(dr["ind_Credentials"].ToString()); MailMessage message = new MailMessage(); SmtpClient smtp = new SmtpClient(); NetworkCredential mailAuthentication = new NetworkCredential(EmailId, EmailPassword); message.To.Add(new MailAddress(email.To)); message.From = new MailAddress(From); message.IsBodyHtml = true; message.Subject = email.Subject; message.Body = email.Message; smtp.UseDefaultCredentials = DefaultCredations; smtp.EnableSsl = true; smtp.Port = 25; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.Host = SMTP; smtp.Credentials = new NetworkCredential(EmailId, EmailPassword); smtp.Send(message); } catch (SmtpException smtpEx) { errmsg = string.Format("alert('There was a problem in sending the email: {0}');", smtpEx.Message.Replace("'", "\\'")); } catch (Exception generalEx) { errmsg = string.Format("alert('There was a general problem: {0}');", generalEx.Message.Replace("'", "\\'")); } } else errmsg = "An error accured whilte getting email settings from database, process couldn't be completed"; return errmsg; } }

    Read the article

  • sending email in .NET

    - by VP
    I am getting the following error when I try to send an email in my C# program. I am using Visual Studio 2008 on windows 7. I would paste my code first and then the error: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Net; using System.Net.Mail; using System.Net.Mime; using System.Net.Sockets; using System.Web; class email_log_files { private string login_username = "my_gmail_id"; private string login_password = "my_gmail_password"; public void send_email() { string src_address = "[email protected]"; string dest_address = "[email protected]"; try { MailMessage email_msg = new MailMessage(); SmtpClient email_client = new SmtpClient(); email_msg.From = new MailAddress(src_address); email_msg.Sender = new MailAddress(src_address); email_msg.ReplyTo = new MailAddress(src_address); email_msg.To.Add(dest_address); email_msg.Subject = "Test"; email_msg.Body = "Body of the message"; NetworkCredential credentials = new NetworkCredential(login_username, login_password); email_client.Credentials = credentials; email_client.Host = "smtp.gmail.com"; email_client.Port = 465; email_client.EnableSsl = true; email_client.Send(email_msg); Console.WriteLine("Message Sent Successfully!!"); Console.ReadLine(); } catch (Exception ex) { Console.WriteLine(ex.Message.ToString()); Console.WriteLine(ex.InnerException); Console.WriteLine(ex.Source); Console.WriteLine(ex.Data); Console.ReadLine(); } } } And the error message is as follows: The operation has timed out. System System.Collections.ListDictionaryInternal Why is it always timing out? I am sure that I have the correct smtp server address and port number for gmail as I have configured my outlook with the same. Any help or ideas?

    Read the article

  • New to asp.net. Need help debugging this email form.

    - by Roeland
    Hey guys, First of all, I am a php developer and most of .net is alien to me which is why I am posting here! I just migrated over a site from one set of webhosting to another. The whole site is written in .net. None of the site is database driven so most of it works, except for the contact form. The output on the site simple states there was an error with "There has been an error - please try to submit the contact form again, if you continue to experience problems, please notify our webmaster." This is just a simple message it pops out of it gets to the "catch" part of the email function. I went into web.config and changed the parameters: <emailaddresses> <add name="System" value="[email protected]"/> <add name="Contact" value="[email protected]"/> <add name="Info" value="[email protected]"/> </emailaddresses> <general> <add name="WebSiteDomain" value="hoyespharmacy.com"/> </general> Then the .cs file for contact contains the mail function EmailFormData(): private void EmailFormData() { try { StringBuilder body = new StringBuilder(); body.Append("Name" + ": " + txtName.Text + "\n\r"); body.Append("Phone" + ": " + txtPhone.Text + "\n\r"); body.Append("Email" + ": " + txtEmail.Text + "\n\r"); body.Append("Fax" + ": " + txtEmail.Text + "\n\r"); body.Append("Subject" + ": " + ddlSubject.SelectedValue + "\n\r"); body.Append("Message" + ": " + txtMessage.Text); MailMessage mail = new MailMessage(); mail.IsBodyHtml = false; mail.To.Add(new MailAddress(Settings.GetEmailAddress("System"))); mail.Subject = "Contact Us Form Submission"; mail.From = new MailAddress(Settings.GetEmailAddress("System"), Settings.WebSiteDomain); mail.Body = body.ToString(); SmtpClient smtpcl = new SmtpClient(); smtpcl.Send(mail); } catch { Utilities.RedirectPermanently(Request.Url.AbsolutePath + "?messageSent=false"); } } How do I see what the actual error is. I figure I can do something with the "catch" part of the function.. Any pointers? Thanks!

    Read the article

  • Using SSIS to send a HTML E-Mail Message with built-in table of Counts.

    - by Kevin Shyr
    For the record, this can be just as easily done with a .NET class with a DLL call.  The two major reasons for this ending up as a SSIS package are: There are a lot of SQL resources for maintenance, but not as many .NET developers. There is an existing automated process that links up SQL Jobs (more on that in the next post), and this is part of that process.   To start, this is what the SSIS looks like: The first part of the control flow is just for the override scenario.   In the Execute SQL Task, it calls a stored procedure, which already formats the result into XML by using "FOR XML PATH('Row'), ROOT(N'FieldingCounts')".  The result XML string looks like this: <FieldingCounts>   <Row>     <CellId>M COD</CellId>     <Mailed>64</Mailed>     <ReMailed>210</ReMailed>     <TotalMail>274</TotalMail>     <EMailed>233</EMailed>     <TotalSent>297</TotalSent>   </Row>   <Row>     <CellId>M National</CellId>     <Mailed>11</Mailed>     <ReMailed>59</ReMailed>     <TotalMail>70</TotalMail>     <EMailed>90</EMailed>     <TotalSent>101</TotalSent>   </Row>   <Row>     <CellId>U COD</CellId>     <Mailed>91</Mailed>     <ReMailed>238</ReMailed>     <TotalMail>329</TotalMail>     <EMailed>291</EMailed>     <TotalSent>382</TotalSent>   </Row>   <Row>     <CellId>U National</CellId>     <Mailed>63</Mailed>     <ReMailed>286</ReMailed>     <TotalMail>349</TotalMail>     <EMailed>374</EMailed>     <TotalSent>437</TotalSent>   </Row> </FieldingCounts>  This result is saved into an internal SSIS variable with the following settings on the General tab and the Result Set tab:   Now comes the trickier part.  We need to use the XML Task to format the XML string result into an HTML table, and I used Direct input XSLT And here is the code of XSLT: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/>   <xsl:template match="/ROOT">         <table border="1" cellpadding="6">           <tr>             <td></td>             <td>Mailed</td>             <td>Re-mailed</td>             <td>Total Mail (Mailed, Re-mailed)</td>             <td>E-mailed</td>             <td>Total Sent (Mailed, E-mailed)</td>           </tr>           <xsl:for-each select="FieldingCounts/Row">             <tr>               <xsl:for-each select="./*">                 <td>                   <xsl:value-of select="." />                 </td>               </xsl:for-each>             </tr>           </xsl:for-each>         </table>   </xsl:template> </xsl:stylesheet>    Then a script task is used to send out an HTML email (as we are all painfully aware that SSIS Send Mail Task only sends plain text) Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 using System; using System.Data; using Microsoft.SqlServer.Dts.Runtime; using System.Windows.Forms; using System.Net.Mail; using System.Net;   namespace ST_b829a2615e714bcfb55db0ce97be3901.csproj {     [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]     public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase     {           #region VSTA generated code         enum ScriptResults         {             Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,             Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure         };         #endregion           public void Main()         {             String EmailMsgBody = String.Format("<HTML><BODY><P>{0}</P><P>{1}</P></BODY></HTML>"                                                 , Dts.Variables["Config_SMTP_MessageSourceText"].Value.ToString()                                                 , Dts.Variables["InternalStr_CountResultAfterXSLT"].Value.ToString());             MailMessage EmailCountMsg = new MailMessage(Dts.Variables["Config_SMTP_From"].Value.ToString().Replace(";", ",")                                                         , Dts.Variables["Config_SMTP_Success_To"].Value.ToString().Replace(";", ",")                                                         , Dts.Variables["Config_SMTP_SubjectLinePrefix"].Value.ToString() + " " + Dts.Variables["InternalStr_FieldingDate"].Value.ToString()                                                         , EmailMsgBody);             //EmailCountMsg.From.             EmailCountMsg.CC.Add(Dts.Variables["Config_SMTP_Success_CC"].Value.ToString().Replace(";", ","));             EmailCountMsg.IsBodyHtml = true;               SmtpClient SMTPForCount = new SmtpClient(Dts.Variables["Config_SMTP_ServerAddress"].Value.ToString());             SMTPForCount.Credentials = CredentialCache.DefaultNetworkCredentials;               SMTPForCount.Send(EmailCountMsg);               Dts.TaskResult = (int)ScriptResults.Success;         }     } } Note on this code: notice the email list has Replace(";", ",").  This is only here because the list is configurable in the SQL Job Step at Set Values, which does not react well with colons as email separator, but system.Net.Mail only handles comma as email separator, hence the extra replace in the string. The result is a nicely formatted email message with count information:

    Read the article

  • Powershell script to send e-mails, losing text in e-mail attachment

    - by Beuy
    I have the following function to send e-mails in powershell with attachments: function SendMail(){ if($e -ine '') { $mail = New-Object System.Net.Mail.MailMessage $mail.From = $f; $mail.To.Add($t); $mail.Subject = $s; $att = New-Object System.Net.Mail.Attachment –ArgumentList $l $mail.Attachments.Add($att) $mail.Body = $b; $smtp = New-Object System.Net.Mail.SmtpClient($serv); $smtp.Send($mail); } } When I try to send a .txt file attachment it seems to strip out all of the information from within the text file. Any suggestions as to what's going wrong?

    Read the article

  • Powershell script to send e-mails, loosing text in e-mail attachment

    - by Beuy
    I have the following function to send e-mails in powershell with attachments: function SendMail(){ if($e -ine '') { $mail = New-Object System.Net.Mail.MailMessage $mail.From = $f; $mail.To.Add($t); $mail.Subject = $s; $att = New-Object System.Net.Mail.Attachment –ArgumentList $l $mail.Attachments.Add($att) $mail.Body = $b; $smtp = New-Object System.Net.Mail.SmtpClient($serv); $smtp.Send($mail); } } When I try to send a .txt file attachment it seems to strip out all of the information from within the text file. Any suggestions as to what's going wrong?

    Read the article

  • CodePlex Daily Summary for Monday, August 04, 2014

    CodePlex Daily Summary for Monday, August 04, 2014Popular ReleasesSpace Engineers Server Manager: SESM V1.11: V1.11 - Added the rename option in the map manager - Added the possibility to select map without starting the server - Upgraded the diagnosis page, now more usefull, more colorful, and with a big check/cross sign to tell you if your installation is healthy. Seriously, you must check it out ^^ - Corrected issue #7, now the asteroid count is the real number of asteroid of the current map - Corrected issue #8, the CPU/RAM value of the stats page should be much more accurate nowJson.NET: Json.NET 6.0 Release 4: New feature - Added Merge to LINQ to JSON New feature - Added JValue.CreateNull and JValue.CreateUndefined New feature - Added Windows Phone 8.1 support to .NET 4.0 portable assembly New feature - Added OverrideCreator to JsonObjectContract New feature - Added support for overriding the creation of interfaces and abstract types New feature - Added support for reading UUID BSON binary values as a Guid New feature - Added MetadataPropertyHandling.Ignore New feature - Improv...VidCoder: 1.5.24 Beta: Added NL-Means denoiser. Updated HandBrake core to SVN 6254. Added extra error handling to DVD player code to avoid a crash when the player was moved.PowerShell App Deployment Toolkit: PowerShell App Deployment Toolkit v3.1.5: *Added Send-Keys function to send a sequence of keys to an application window (Thanks to mmashwani) *Added 3 optimization/stability improvements to Execute-Process following MS best practice (Thanks to mmashwani) *Fixed issue where Execute-MSI did not use value from XML file for uninstall but instead ran all uninstalls silently by default *Fixed error on 1641 exit code (should be a success like 3010) *Fixed issue with error handling in Invoke-SCCMTask *Fixed issue with deferral dates where th...AutoUpdater.NET : Auto update library for VB.NET and C# Developer: AutoUpdater.NET 1.3: Fixed problem in DownloadUpdateDialog where download continues even if you close the dialog. Added support for new url field for 64 bit application setup. AutoUpdater.NET will decide which download url to use by looking at the value of IntPtr.Size. Added German translation provided by Rene Kannegiesser. Now developer can handle update logic herself using event suggested by ricorx7. Added italian translation provided by Gianluca Mariani. Fixed bug that prevents Application from exiti...HigLabo: HigLabo_20140801: ■Summary Add feature to create SmtpMessage object from System.Net.Mail.MailMessage, HigLabo.Mime.MailMessage. Add feature to get mail header only by using ImapClient. Add some of Portable class library project. Modify Async internal implementation. -------------------------------------------------- ■HigLabo.Converter Bug fix of QuotedPrintableConverter when last char of line is whitespace or tab. ■HigLabo.Core Modify code to add HigLabo.Core.Pcl project. ■HigLabo.Mail Add feature to create...SEToolbox: SEToolbox 01.041.012 Release 1: Added voxel material textures to read in with mods. Fixed missing texture replacements for mods. Fixed rounding issue in raytrace code. Fixed repair issue with corrupt checkpoint file. Fixed issue with updated SE binaries 01.041.012 using new container configuration.Dynamics CRM 2013 Global Advanced Find: Global Advanced Find Solution v1.0.0.0: Global Advanced Find Managed Solution v1.0.0.0Magick.NET: Magick.NET 6.8.9.601: Magick.NET linked with ImageMagick 6.8.9.6 Breaking changes: - Changed arguments for the Map method of MagickImage. - QuantizeSettings uses Riemersma by default.Multiple Threads TCP Server: Project: this Project is based on VS 2013, .net freamwork 4.0, you can open it by vs 2010 or laterAricie Shared: Aricie.Shared Version 1.8.00: Version 1.8.0 - Release Notes New: Expression Builder to design Flee Expressions New: Cryptographic helpers and configuration classes Improvement: Many fixes and improvements with property editor Improvement: Token Replace Property explorer now has a restricted mode for additional security Improvement: Better variables, types and object manipulation Fixed: smart file and flee bugs Fixed: Removed Exception while trying to read unsuported files Improvement: several performance twe...DataBind: DataBind 1.0: - Efficiency ImprovedConsole Progress Bar: ConsoleProgressBar-0.3: - Validate ProgressInPercentageGum UI Tool: Gum 0.6.07: Fixed bug related to setting the parent to screen bounds.Accesorios de sitios Torrent en Español para Synology Download Station: Pack de Torrents en Español 6.0.0: Agregado los módulos de DivXTotal, el módulo de búsqueda depende del de alojamiento para bajar las series Utiliza el rss: http://www.divxtotal.com/rss.php DbEntry.Net (Leafing Framework): DbEntry.Net 4.2: DbEntry.Net is a lightweight Object Relational Mapping (ORM) database access compnent for .Net 4.0+. It has clearly and easily programing interface for ORM and sql directly, and supoorted Access, Sql Server, MySql, SQLite, Firebird, PostgreSQL and Oracle. It also provide a Ruby On Rails style MVC framework. Asp.Net DataSource and a simple IoC. DbEntry.Net.v4.2.Setup.zip include the setup package. DbEntry.Net.v4.2.Src.zip include source files and unit tests. DbEntry.Net.v4.2.Samples.zip ...Azure Storage Explorer: Azure Storage Explorer 6 Preview 1: Welcome to Azure Storage Explorer 6 Preview 1 This is the first release of the latest Azure Storage Explorer, code-named Phoenix. What's New?Here are some important things to know about version 6: Open Source Now being run as a full open source project. Full source code on CodePlex. Collaboration encouraged! Updated Code Base Brand-new code base (WPF/C#/.NET 4.5) Visual Studio 2013 solution (previously VS2010) Uses the Task Parallel Library (TPL) for asynchronous background operat...Wsus Package Publisher: release v1.3.1407.29: Updated WPP to recognize the very latest console version. Some files was missing into the latest release of WPP which lead to crash when trying to make a custom update. Add a workaround to avoid clipboard modification when double-clicking on a label when creating a custom update. Add the ability to publish detectoids. (This feature is still in a BETA phase. Packages relying on these detectoids to determine which computers need to be updated, may apply to all computers).VG-Ripper & PG-Ripper: PG-Ripper 1.4.32: changes NEW: Added Support for 'ImgMega.com' links NEW: Added Support for 'ImgCandy.net' links NEW: Added Support for 'ImgPit.com' links NEW: Added Support for 'Img.yt' links FIXED: 'Radikal.ru' links FIXED: 'ImageTeam.org' links FIXED: 'ImgSee.com' links FIXED: 'Img.yt' linksAsp.Net MVC-4,Entity Framework and JQGrid Demo with Todo List WebApplication: Asp.Net MVC-4,Entity Framework and JQGrid Demo: Asp.Net MVC-4,Entity Framework and JQGrid Demo with simple Todo List WebApplication, Overview TodoList is a simple web application to create, store and modify Todo tasks to be maintained by the users, which comprises of following fields to the user (Task Name, Task Description, Severity, Target Date, Task Status). TodoList web application is created using MVC - 4 architecture, code-first Entity Framework (ORM) and Jqgrid for displaying the data.New ProjectsAndroid_Games: Free downloadsDailyProgrammer Challenge 173: My solution to /r/dailyprogrammer Challenge #173EmotionPing: This a littel software to make ping to a net ip rangeEntityMapper: Library for mapping (or projecting) Entity types (Domain Model) to DTO types (Contract). Made to be compatible with the Linq Provider for Entity Framework.kevinsheldon: private collectionKeyboard Auto-Complete for PC: Did you ever use the auto-complete in mobile phones? Why not on PC?? Now you can!LetsPlay: W co pograsz dzisiaj? Wybierz jedna z gier zainstalowanych w systemie i graj do woli:)Mini ORM like Enterprise library Data Block: A mini ORM like Enterprise library Data Block.ProjkyAddin ssms addin script shortcut ssmsaddin: ProjkyAddin ???Management Studio ??,??SSMS 2005、SSMS 2008、SSMS 2008 R2、SSMS 2012、SSMS 2014,?????????????Management Studio????????????,????????????????????。Reddit Downvote Bot: Reddit Downvote Bot , Mass Downvote a certain reddit user.SQL Server Dialog: This SQL Server Dialog is now release in v.1.0.0VNTalk Messenger: VNTalk MessengerWindyPaper: Test Project

    Read the article

  • .NET and SMTP Configuration

    - by koevoeter
    Sometimes I feel stupid about discovering .NET features that have been there since an old release (2.0 in this case)... Apparently you can just use this configSecion “mailSettings” and never have to configure your SmtpClient instance in code again (no, not hard-coded): <system.net>     <mailSettings>         <smtp deliveryMethod="Network" from="My Display Name &lt;[email protected]&gt;">             <network host="mail.server.com" />         </smtp>     </mailSettings> </system.net> Now you can go all like: new SmtpClient().Send(mailMessage); …and everything is configured for you, even the from address (which you can obviously override).

    Read the article

  • How do you avoid name similarities between your classes and the native ones?

    - by Oscar
    I just ran into an "interesting problem", which I would like your opinion about: I am developing a system and for many reasons (meaning: abstraction, technology independence, etc) we create our own types for exchanging information. For instance: if there is a method which is called SendEmail and is invoked by the business logic, it way have a parameter of type OurCompany.EMailMessage, which is an object which is completely technology independent and contains only "business relevant data" (for instance, no information abut head encoding). Inside the SendEmail function, we get this information from our EMailMEssage object and create a MailMessage (this one is technolgy specific) object so it can be sent over the network. As you can already notice, our class has a very similar name to the "native" language class. The problem is: this is exactly what they are, email messages, so it is hard to find another meaningful name for them. Do you have this problem often? How do you manage it? Edit: @mgkrebbs just commented about using fully qualified names. This is our current approach, but a little bit too verbose, IMHO. I would like something cleaner, if possible.

    Read the article

  • ASP.NET Send Image Attachment With Email Without Saving To Filesystem

    - by KGO
    I'm trying to create a form that will send an email with an attached image and am running into some problems. The form I am creating is rather large so I have created a small test form for the purpose of this question. The email will send and the attachment will exist on the email, but the image is corrupt or something as it is not viewable. Also.. I do not want to save the image to the filesystem. You may think it is convoluted to take the image file from the fileupload to a stream, but this is due to the fact that the real form I am working on will allow multiple files to be added through a single fileupload and will be saved in session, thus the images will not be coming from the fileupload control directly on submit. File: TestAttachSend.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestAttachSend.aspx.cs" Inherits="TestAttachSend" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <h1>Send Email with Image Attachment</h1> Email Address TO: <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox><br /> Attach JPEG Image: <asp:FileUpload ID="fuImage" runat="server" /><br /> <br /> <asp:Button ID="btnSend" runat="server" Text="Send" onclick="btnSend_Click" /><br /> <br /> <asp:label ID="lblSent" runat="server" text="Image Sent!" Visible="false" EnableViewState="false"></asp:label> </div> </form> </body> </html> File: TestAttachSend.aspx.cs using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Net.Mail; using System.IO; public partial class TestAttachSend : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnSend_Click(object sender, EventArgs e) { if (fuImage.HasFile && fuImage.PostedFile.ContentType == System.Net.Mime.MediaTypeNames.Image.Jpeg) { SmtpClient emailClient = new SmtpClient(); MailMessage EmailMsg = new MailMessage(); EmailMsg.To.Add(txtEmail.Text.Trim()); EmailMsg.From = new MailAddress(txtEmail.Text.Trim()); EmailMsg.Subject = "Attached Image"; EmailMsg.Body = "Image is attached!"; MemoryStream imgStream = new MemoryStream(); System.Drawing.Image img = System.Drawing.Image.FromStream(fuImage.PostedFile.InputStream); string filename = fuImage.PostedFile.FileName; img.Save(imgStream, System.Drawing.Imaging.ImageFormat.Jpeg); EmailMsg..Attachments.Add(new Attachment(imgStream, filename, System.Net.Mime.MediaTypeNames.Image.Jpeg)); emailClient.Send(EmailMsg); lblSent.Visible = true; } } }

    Read the article

  • asp.net external form loading into jquery dialog submit button issue

    - by Mark
    I am loading an external file 'contact_us.aspx' into a jquery dialog box. the external page contains a form. When the submit button is pressed it closes the dialog box and changes the page to contact_us.aspx. is my code correct or is there a different way of doing this. see my code below, thanks. This JS is in y masterpage: <script type="text/javascript"> $(document).ready(function() { var dialogOpts = { modal: true, bgiframe: true, autoOpen: false, height: 500, width: 500, open: function(type, data) { $(this).parent().appendTo(jQuery("form:first")); } } $("#genericContact").dialog(dialogOpts); //end dialog $('a.conactGeneric').click( function() { $("#genericContact").load("contact_us.aspx", [], function() { $("#genericContact").dialog("open"); } ); return false; } ); }); </script> The external file 'contact_us.aspx' which is loaded into the dialog box, when the link is clicked. <asp:Panel ID="pnlEnquiry" runat="server" DefaultButton="btn_Contact"> <asp:Label ID="lblError" CssClass="error" runat="server" Visible="false" Text=""></asp:Label> <div class="contact_element"> <label for="txtName">Your Name <span>*</span></label> <asp:TextBox CssClass="contact_field" ID="txtName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator CssClass="contact_error" ControlToValidate="txtName" Display="Dynamic" ValidationGroup="valContact" ID="RequiredFieldValidator1" runat="server" ErrorMessage="Enter your name"></asp:RequiredFieldValidator> </div> <div class="contact_element"> <label for="txtName">Phone Number</label> <asp:TextBox CssClass="contact_field" ID="txtTel" runat="server"></asp:TextBox> <asp:RequiredFieldValidator CssClass="contact_error" ControlToValidate="txtTel" Display="Dynamic" ValidationGroup="valContact" ID="RequiredFieldValidator2" runat="server" ErrorMessage="Enter your phone number"></asp:RequiredFieldValidator> </div> <div class="contact_element"> <label for="txtEmail">Your Email <span>*</span></label> <asp:TextBox CssClass="contact_field" ID="txtEmail" runat="server"></asp:TextBox> <asp:RequiredFieldValidator CssClass="contact_error" ControlToValidate="txtEmail" Display="Dynamic" ValidationGroup="valContact" ID="RequiredFieldValidator3" runat="server" ErrorMessage="Enter your email address"></asp:RequiredFieldValidator> </div> <div class="contact_element"> <label for="txtQuestion">Question <span>*</span></label> <asp:TextBox TextMode="MultiLine" CssClass="contact_question" ID="txtQuestion" runat="server"></asp:TextBox> <asp:RequiredFieldValidator CssClass="contact_error" ControlToValidate="txtQuestion" Display="Dynamic" ValidationGroup="valContact" ID="RequiredFieldValidator4" runat="server" ErrorMessage="Enter your question"></asp:RequiredFieldValidator> </div> <div class="contact_chkbox"> <asp:CheckBox ID="chkNews" runat="server" Checked="true" Text="Receive our monthly newsletter" EnableTheming="false" /> </div> <span class="mandatory">* Required Field</span> <asp:LinkButton ID="btn_Contact" ToolTip="Submit" CssClass="submit_btn" ValidationGroup="valContact" runat="server" OnClick="SignUp" ></asp:LinkButton> <asp:RegularExpressionValidator CssClass="contact_error" ID="RegularExpressionValidator1" runat="server" ValidationExpression=".*@.{2,}\..{2,}" Display="Dynamic" ValidationGroup="valContact" ControlToValidate="txtEmail" ErrorMessage="Invalid email format."></asp:RegularExpressionValidator> <asp:ValidationSummary ID="ValidationSummary1" ValidationGroup="valContact" ShowMessageBox=true ShowSummary=false runat="server" /> </asp:Panel> <asp:Panel ID="pnlThanks" runat="server" Visible="false"> <h1>Thank you!</h1> </asp:Panel> code behind file: protected void SignUp(object sender, EventArgs e) { SmtpMail.SmtpServer = "localhost"; MailMessage myMail = new MailMessage(); //String myToEmail = MyDB.getScalar("select setting_value from [Website.Settings]"); ; //myMail.To = myToEmail; myMail.To = "[email protected]"; myMail.From = "[email protected]"; //myMail.Bcc = "[email protected]"; myMail.Subject = "Enquiry from the Naturetrek Site"; StringBuilder myContent = new StringBuilder(); myContent.Append("Name : " + txtName.Text + "\r\n"); myContent.Append("Email: " + txtEmail.Text + "\r\n"); myContent.Append("Telephone: " + txtTel.Text + "\r\n"); myContent.Append("\r\nTheir Question: \r\n" + txtQuestion.Text + "\r\n"); if (chkNews.Checked != true) { myContent.Append("Subscribed to newsletter: No"); } else { myContent.Append("Subscribed to newsletter: Yes"); } myContent.Append("\r\n"); myMail.Body = myContent.ToString(); SmtpMail.Send(myMail); pnlEnquiry.Visible = false; pnlThanks.Visible = true; }

    Read the article

  • FileSystemWatcher.WaitForChanged returns, but there is still a lock on the file

    - by SnOrfus
    I have a program that send a document to a pdf printer driver and that driver prints to a particular directory. After the print I want to attach the pdf to an e-mail (MailMessage) and send it off. Right now, I send the document to the printer (wich spawns a new process) and then call a FileSystemWatcher.WaitForChanged(WaitForChangedResult.Created) but when the object is created, it's still not done "printing" and the pdf printer still has a lock on it, throwing an error when I try to attach that file to an e-mail. I've considered a plain Thread.Sleep(2000) or whatever, but that's far less than ideal. I considered putting the attachment code in a try/catch block and looping on failure, but again, that's just bad news. I can't really think of an elegant solution.

    Read the article

  • SMTP error: "Client does not have permission to submit mail to this server"

    - by Raj Kumar
    I'm getting the following error while sending email. What could be the cause? Client does not have permission to submit mail to this server. The server response was: 5.5.1 STARTTLS may not be repeated. Here's the stack trace... Stack Trace at System.Net.Mail.StartTlsCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.StartTlsCommand.Send(SmtpConnection conn) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) I'm connecting to smtp.gmail.com with SSL on port 587 / 465

    Read the article

  • Add Email addressCollection to, cc, bcc and replytoList

    - by san
    i want to add MailAddressCollection with to,cc,bcc and replytolist of my MailMessage(Net.Mail) my code Like MessageEntity.To.Add(GetMailAddress(TOEmailAddress)); MessageEntity.CC.Add(GetMailAddress(CCEmailAddress)); MessageEntity.Bcc.Add(GetMailAddress(BCCEmailAddress)); MessageEntity.RepltToList.Add(GetMailAddress(ReplyEmailAddress)); private static MailAddressCollection GetMailAddress(List<string> LstMailAddress) { MailAddressCollection MAddressCollection = new MailAddressCollection(); if (MailAddress != null) { foreach (string EmailAddress in MailAddress) { if (IsValidEmailId(EmailAddress)) { MAddressCollection.Add((new MailAddress(EmailAddress))); } } } return MAddressCollection; } It is showing the error cannot convert from 'System.Net.Mail.MailAddressCollection' to 'string' Is it possible to add the EmailAddressCollection to email's to/cc/bcc/ReplyToList? Thanks San

    Read the article

  • Why would a CSV attachment appear as text in the body?

    - by David
    Hi all I've just implemented some code that emails a bunch of our clients with a CSV file attachment. Some (not many) have got back to us complaining that they don't get an attachment at all - just the CSV text inside the body of the email. Most however are fine. I suspect that it's different mail clients that are treating the attachment differently but I don't have enough info yet to be sure. I'm using .NET's MailMessage class with the Attachment.CreateAttachmentFromString() method. The MIME type I'm specifying for the attachment is text/csv. Anyone have any idea what the heck is going on? Ta muchly David

    Read the article

  • Is there an equivalence to CDOSYS AutoGenerateTextBody in .NET

    - by AnthonyWJones
    I'm porting some VBScript code which generates emails using the standard CDOSYS Message object. The Message oject has a property AutoGenerateTextBody which when true will cause it to automatically create the TextBody property value when you assign HTML to the HTMLBody property. Hence creating the typical text/plain and text/html alternatives in the message body. However .NET appears to be missing this function. The MailMessage object does have the ability to create alternative views but there doesn't appear to be a way to easily create the text body content from the HTML content. I'm not necessarily looking for an auto-magic option but I do need a solution to taking what is an HTML string and converting it to a reasonable plain text representation. Just dropping all the HTML markup doesn't cut it. Is there a tool buried somewhere in the existing .NET framework that can do this?

    Read the article

  • what is means of this problem when sending email through web-application

    - by Richa Media and services
    i have this error when i sending email through our web application " Mailbox unavailable. The server response was: Requested action not taken: mailbox unavailable or not local" this is detail of error System.Net.Mail.SmtpFailedRecipientException was caught Message=Mailbox unavailable. The server response was: Requested action not taken: mailbox unavailable or not local Source=System FailedRecipient=<[email protected]> StackTrace: at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at email.Globals.SendMail(String EmailID, String subject, String message, String senderMail) in C:location InnerException:

    Read the article

  • How to get email from pop.gmail.com using c#?

    - by jiya gupta
    hi, i want to read email from pop.gmail.com using console application. Pop3 client = new Pop3(); client.Connect("pop.gmail.com",995); client.Login("[email protected]", "12345"); //client.IsAuthenticated = true; // get message list Pop3MessageCollection list = client.GetMessageList(); if (list.Count == 0) { Console.WriteLine("There are no messages in the mailbox."); } else { // download the first message MailMessage message = client.GetMailMessage(list[0].SequenceNumber); } client.Disconnect(); } i got error server has closed the connection. i have already disable firewall and antivirus. plz help me.

    Read the article

  • parallel.foreach with custom collection

    - by SchwartzE
    I am extending the System.Net.Mail.MailAddress class to include an ID field, so I created a new custom MailAddress class that inherited from the existing class and a new custom MailAddressCollection class. I then overrode the existing System.Net.Mail.MailMessage.To to use my new collection. I would like to process the recipients in parallel, but I can't get the syntax right. This is the syntax I am using. Parallel.ForEach(EmailMessage.To, (MailAddress address) => { emailService.InsertRecipient(emailId, address.DisplayName, address.Address, " "); }); I get the following errors: The best overloaded method match for 'System.Threading.Tasks.Parallel.ForEach(System.Collections.Generic.IEnumerable, System.Action)' has some invalid arguments Argument 1: cannot convert from 'EmailService.MailAddressCollection' to 'System.Collections.Generic.IEnumerable' What syntax do I need to use custom collections?

    Read the article

  • email output of powershell script

    - by Gordon Carlisle
    I found this wonderful script that outputs the status of the current DFS backlog to the powershell console. This works great, but I need the script to email me so I can schedule it to run nightly. I have tried using the Send-MailMessage command, but can't get it to work. Mainly because my powershell skills are very weak. I believe most of the issue revolve around the script using the Write-Host command. While the coloring is nice I would much rather have it email me the results. I also need the solution to be able to specify a mail server since the dfs servers don't have email capability. Any help or tips are welcome and appreciated. Here is the code. $RGroups = Get-WmiObject -Namespace "root\MicrosoftDFS" -Query "SELECT * FROM DfsrReplicationGroupConfig" $ComputerName=$env:ComputerName $Succ=0 $Warn=0 $Err=0 foreach ($Group in $RGroups) { $RGFoldersWMIQ = "SELECT * FROM DfsrReplicatedFolderConfig WHERE ReplicationGroupGUID='" + $Group.ReplicationGroupGUID + "'" $RGFolders = Get-WmiObject -Namespace "root\MicrosoftDFS" -Query $RGFoldersWMIQ $RGConnectionsWMIQ = "SELECT * FROM DfsrConnectionConfig WHERE ReplicationGroupGUID='"+ $Group.ReplicationGroupGUID + "'" $RGConnections = Get-WmiObject -Namespace "root\MicrosoftDFS" -Query $RGConnectionsWMIQ foreach ($Connection in $RGConnections) { $ConnectionName = $Connection.PartnerName.Trim() if ($Connection.Enabled -eq $True) { if (((New-Object System.Net.NetworkInformation.ping).send("$ConnectionName")).Status -eq "Success") { foreach ($Folder in $RGFolders) { $RGName = $Group.ReplicationGroupName $RFName = $Folder.ReplicatedFolderName if ($Connection.Inbound -eq $True) { $SendingMember = $ConnectionName $ReceivingMember = $ComputerName $Direction="inbound" } else { $SendingMember = $ComputerName $ReceivingMember = $ConnectionName $Direction="outbound" } $BLCommand = "dfsrdiag Backlog /RGName:'" + $RGName + "' /RFName:'" + $RFName + "' /SendingMember:" + $SendingMember + " /ReceivingMember:" + $ReceivingMember $Backlog = Invoke-Expression -Command $BLCommand $BackLogFilecount = 0 foreach ($item in $Backlog) { if ($item -ilike "*Backlog File count*") { $BacklogFileCount = [int]$Item.Split(":")[1].Trim() } } if ($BacklogFileCount -eq 0) { $Color="white" $Succ=$Succ+1 } elseif ($BacklogFilecount -lt 10) { $Color="yellow" $Warn=$Warn+1 } else { $Color="red" $Err=$Err+1 } Write-Host "$BacklogFileCount files in backlog $SendingMember->$ReceivingMember for $RGName" -fore $Color } # Closing iterate through all folders } # Closing If replies to ping } # Closing If Connection enabled } # Closing iteration through all connections } # Closing iteration through all groups Write-Host "$Succ successful, $Warn warnings and $Err errors from $($Succ+$Warn+$Err) replications." Thanks, Gordon

    Read the article

  • 'Cannot get iis pickup directory' in Windows Server 2012

    - by Meat Popcicle
    Our system moved from Windows Server 2003(Enterprise SP2) & IIS 6. And new system is Windows Server 2012(Standard) and IIS 6(for smtp mail) & 8. I copied all of web application files and IIS settings, another function is ok but.. email system is something wrong. for example, --------------------------------------------------------------------------------------- exception: system.Net.Mail.SmtpException: cannot get iis pickup directory. line 284: SendMail sendmail = new SendMail(); line 285: sendmail.GetSendMail(messagefrom, Useremail, mailsubject, message); stack trace: [SmtpException: cannot get iis pickup directory.] System.Net.Mail.IisPickupDirectory.GetPickupDirectory() +1894 System.Net.Mail.SmtpClient.Send(MailMessage message) +1956518 CommonDll.SendMail.GetSendMail(String messagefrom, String Useremail, String mailsubject, String message) +466 ASP.common_users_courserecordadd_aspx.AddBtn_Click(Object sender, EventArgs e) in d:\"sourcefile.aspx":285 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981 Microsoft .NET Framework v:2.0.50727.6407; ASP.NET v:2.0.50727.6387 --------------------------------------------------------------------------------------- in Develop server(2008 R2 Ent SP1, IIS6 & 7.5), it works well. confused.

    Read the article

  • How to import a text file into powershell and email it, formatted as HTML

    - by Don
    I'm trying to get a list of all Exchange accounts, format them in descending order from largest mailbox and put that data into an email in HTML format to email to myself. So far I can get the data, push it to a text file as well as create an email and send to myself. I just can't seem to get it all put together. I've been trying to use ConvertTo-Html but it just seems to return data via email like "pageFooterEntry" and "Microsoft.PowerShell.Commands.Internal.Format.AutosizeInfo" versus the actual data. I can get it to send me the right data if i don't tell it to ConvertTo-Html, just have it pipe the data to a text file and pull from it, but it's all ran together with no formatting. I don't need to save the file, i'd just like to run the command, get the data, put it in HTML and mail it to myself. Here's what I have currently: #Connects to Database and returns information on all users, organized by Total Item Size, User $body = Get-MailboxStatistics -database "Mailbox Database 0846468905" | where {$_.ObjectClass -eq “Mailbox”} | Sort-Object TotalItemSize -Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}} -auto | ConvertTo-Html #Pause for 5 seconds for Exchange write-host -foregroundcolor Green "Pausing for 5 seconds for Exchange" Start-Sleep -s 5 $toemail = "[email protected]" # Emails report to this address. $fromemail = "[email protected]" #Emails from this address. $server = "Exchange.company.com" #Exchange server - SMTP. #Email the report. $email = New-Object System.Net.Mail.MailMessage $email.IsBodyHtml = $True $email.To.Add($toemail) $email.From = $fromemail $email.Subject = "Exchange Mailbox Sizes" $email.Body = $body $client = New-Object System.Net.Mail.SmtpClient $server $client.UseDefaultCredentials = $true $client.Send($email) Any thoughts would be helpful, thanks!

    Read the article

  • Retrieve a user's Exchange database in powershell

    - by Paul
    Hey Everyone, I've scoured the interwebs for a few days now off and on to find this. I am creating a powershell script for email-enabling new user's(Exchange 2007). To give you a little background when we have a new hire, their AD account is created at our off-site helpdesk, but they don't create their email account. I'm trying to automate the process of mail-enabling the user which involves putting them in the same database as an existing user, disable imap pop activesync, and lastly email the requester of the ticket. I would like to just get prompted for the New User's name, User to Replicate(mailbox, storage group, database), and the person to email after it's been created. So if someone could just help with a command to Retrieve a user's Exchange database in powershell that would be great, but if people also want to help with my hacked up script please do so as well!!! Here is what I have so far: Write-output “ENTER THE FOLLOWING DETAILS” $DName = Read-Host “User Diplay Name" $RUser = Read-Host "Replicate User(Database Grab)" ***$RData = #get the Replicate user's mailbox database here*** $REmail = #either just use a Read-Host “Requester's Email address" or ask for Requester's name and pipe through their email address by digging for it w/ powershell Enable-Mailbox -Identity "$DName" -Database "$RData" Send-MailMessage -From "John Doe <[email protected]>" -To (put $REmail here which is the Requester's email) -Subject "Test Person's email account" -Body "Test Person's email account has been setup.`n`n`nJohn Doe`nGeneric Company`nSystems Administrator`nOffice: 123.456.7890`[email protected]" -SmtpServer genericexchange.exchange.com

    Read the article

  • Emails not sending from outlook / OWA - Not even hitting the mail queue in exchange

    - by webnoob
    We are having an issue this morning where we can receive external emails but cannot send internal or external ones from Outlook or OWA. If I use: Send-MailMessage –From <[email protected]> –To <[email protected]> –Subject “Test #01”-Body “Just a test message.” –SMTPServer <Server-Name> –Credential <domain\user> the email is sent correctly which makes me think there is a connection issue with OWA and Outlook. However, outlook is reporting as Connected with exchange. I have checked the message tracking in exchange tools and emails sent via outlook and OWA do not appear. Nothing has changed on the server on the weekend so I don't really know where to start debugging this issue. We are using Windows SBS 2011. We only have one send connector which isn't using Smart Hosts and is set to use DNS MX records. Use external DNS is not checked and I can ping google.com etc so doesn't appear to be a DNS issue (plus the email sends from the console anyway). EDIT It appears that users using IMAP can send emails correctly, its only ones that rely on the normal exchange connection type that don't work. EDIT Emails from IMAP are hitting the email queue's where as emails from the normal exchange accounts aren't. EDIT It seems that some of the emails we tried to send yesterday sent at about 1am but now it won't work again..

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >