Rank: Newbie
Groups: Registered
Joined: 2/21/2014(UTC)
Posts: 1
Location: Lagos
PLss help. this is the error i get when i try to send mail with image attachment using the html.csharp sample code: Exception: NEtworking Error:10060 A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond 74.125.136.109.25
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,154
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
It seems that your outgoing 25 port is blocked by your router/firewall/anti-virus/ISP, in this case, you can try to use 587 or 465 port in the sample, you can input smtp.gmail.com 587 smtp.gmail.com 465 as the server address and have SSL checked, then try to send the email
Rank: Newbie
Groups: Registered
Joined: 2/21/2014(UTC)
Posts: 1
Location: Lagos
HI Ivan, Supper. Thanks! that worked. How do i attach an html file to the body of the email not as an attachment. Thanx
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,154
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
Rank: Newbie
Groups: Registered
Joined: 2/21/2014(UTC)
Posts: 1
Location: Lagos
Thanx Ivan, that worked only for a while then it starts sending only characters as the HTML. I have tried creating a new html file which works only once or twice and then it starts sending the chars again. Any suggestions?
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,154
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
could you show me your source code?
Rank: Newbie
Groups: Registered
Joined: 2/21/2014(UTC)
Posts: 1
Location: Lagos
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; // Add EASendMail namespace using EASendMail; namespace EmailList { class Program { static void Main(string[] args) { SmtpMail oMail = new SmtpMail("TryIt"); SmtpClient oSmtp = new SmtpClient(); // Set sender email address, please change it to yours oMail.From = "from email"; // Set recipient email address, please change it to yours oMail.To = "to email"; // Set email subject oMail.Subject = "Cocktail Invite"; // Your SMTP server address SmtpServer oServer = new SmtpServer("smtp.gmail.com"); // User and password for ESMTP authentication, if your server doesn't require // User authentication, please remove the following codes. oServer.User = "mymail"; oServer.Password = "mypass"; // If your smtp server requires implicit SSL connection on 465 port, please add this line oServer.Port = 465; oServer.ConnectType = SmtpConnectType.ConnectSSLAuto; try { // Import html body and also import linked image as embedded images. oMail.ImportHtmlBody("C:\\Users\\COMPUTER2\\Desktop\\test.htm", ImportHtmlBodyOptions.ImportLocalPictures | ImportHtmlBodyOptions.ImportCss); oMail.SaveAs("C:\\Users\\COMPUTER2\\Desktop\\test.htm", true); Console.WriteLine("start to send email ..."); oSmtp.SendMail(oServer, oMail); Console.WriteLine("email was sent successfully!"); } catch (Exception ep) { Console.WriteLine("failed to send email with the following error:"); Console.WriteLine(ep.Message); } } } }
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,154
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
Your codes have no problem. when you call oMail.SaveAs("C:\\Users\\COMPUTER2\\Desktop\\test.htm", true); please save it as oMail.SaveAs("C:\\Users\\COMPUTER2\\Desktop\\test.eml", true); then you can see the correct email.
Rank: Newbie
Groups: Registered
Joined: 2/21/2014(UTC)
Posts: 1
Location: Lagos
Thnx Ivan. that solved it
Forum Jump
EmailArchitect Support
Email Component Development
- EASendMail SMTP Component - .NET Version
- EASendMail SMTP Component - Windows Store Apps
- EASendMail SMTP ActiveX Object
- EAGetMail POP3 & IMAP4 Component - .NET Version
- EAGetMail POP3 & IMAP4 ActiveX Object
Exchange Server and IIS SMTP Plugin
- DomanKeys/DKIM for Exchange Server and IIS SMTP
- Disclaimer and S/MIME for Exchange Server and IIS
EmailArchitect Email Server
- EmailArchitect Email Server (General)
- EmailArchitect Email Server Development
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.