 |
|
|
Hello all,
I did try, and I always get a success in email sending, but I never received the sent email.
I tried to send within the same domain and I succeeded, but when I send from a domain to an external email, I never receive it!
example:from name1@domain1.com to name2@domain2.com (name2 never receives anything). But from name1@domain.com to name2@domain.com (success)
Any Ideas why?
wishes
Joe
|
| Sign In·View Thread·PermaLink | 1.00/5 (2 votes) |
|
|
|
 |
|
|
hi,
i am trying to send out newsletters with the images embedded on to the email
i am able to do it manually by pasting it on to the outlook client (pasting it and not attaching it)
however i want to do it with the help of asp.net and that is what got me on this page
here is the code i have written
Tabs4u.SmtpEmailer emailer = new Tabs4u.SmtpEmailer(); emailer.Host = "XXX.XXX.XXX"; emailer.From = "XXX@XXX.XXX"; emailer.AuthenticationMode = Tabs4u.AuthenticationType.Base64; emailer.User = "XXX@XXX.XXX"; emailer.Password = "XXX"; emailer.Subject = "dynammic mail from asp.net"; emailer.Body = "<html><head><title>newsletter</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'></head><body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><!-- ImageReady Slices (newsletter.psd) --> | <img src='SMS_mailer5.jpg' width='600' height='1000'> | <!-- End ImageReady Slices --></body></html>"; emailer.To.Add("XXX@XXX.XXX"); emailer.To.Add("XXX@XXX.XXX"); emailer.Attachments.Add(new Tabs4u.SmtpAttachment(@"C:\SMS_mailer5.jpg", "image/jpg", Tabs4u.AttachmentLocation.Inline)); //emailer.Attachments.Add(new Tabs4u.SmtpAttachment(@"c:\file1.exe"), "image/jpg", Tabs4u.AttachmentLocation.Inline); //emailer.Attachments.Add(new Tabs4u.SmtpAttachment(@"c:\file2.txt"), "image/jpg", Tabs4u.AttachmentLocation.Inline); emailer.SendAsHtml = true;
emailer.SendMessage();
i do get an email, however the image is in the form of attachments and there is no HTML pages displayed, where am i going wrong?
Thanks in advance. himansu
|
| Sign In·View Thread·PermaLink | 2.33/5 (3 votes) |
|
|
|
 |
|
|
 |
|
|
Hi,
What's the reason for making the "inlineCount" and "attachCount" members static in the SmtpAttachment class? I don't see any good reason to use statics for this ... TBH it looks plain ugly.
The only thing that is done is incrementing those, and they're never reset. Then what is the use of these variables anyway? This looks like a bug to me, without even having used the library.
Greetings
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Confirmed, is a bug after testing. The whole project reeks of lack of quality, makes me wonder why this is still rated at 4.3... I rated 3 and that's before spotting this obvious error. Should've given it 2, tops ...
Anyway, easily solved by making onlineCount & attachCount members of SmtpEmailer class (not static, of course DUH) and incrementing/decrementing on adding/removing attachments. While you're at it, remove the n00b AttachmentList & AddressList classes, they serve absolutely no purpose other than obfuscating things .
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
it's great dll..but I see this exception.. { Exception Details: System.Net.Sockets.SocketException: The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for}  please any one send me the code to work with this dll and a name of a domain already has free POP..plz..all the working-already code. >.with the domain name and format of strings..? for example i have a mail in "Gmail" domain. what can i do to send from it?
thanks very much
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
try { cs = new CryptoStream(new FileStream(attachment.FileName, FileMode.Open,FileAccess.Read, FileShare.Read), new ToBase64Transform(), CryptoStreamMode.Read); } catch(Exception ex) { buf.Append("--- Error with attachment: "); buf.Append(attachment.FileName); buf.Append(" ---"); buf.Append("\r\n"); buf.Append(ex.Message); buf.Append("\r\n"); con.SendCommand(buf.ToString()); return; }
I did not want an automated support email to not be sent if the attachment was not around.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Whenever I send a message, the sent time in Outlook comes in as 5:00PM from the previous day not matter when I send it. Any ideas on how to address this?
Mon 1/30/2006 5:00 PM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
hello, line length has some importance in attachment encoding
SMTPEMailer line 560 should be modified as follow:
// old code num = cs.Read(fbuf, 0, 2048); while(num > 0) { con.SendData(Encoding.ASCII.GetChars(fbuf, 0, num), 0, num); num = cs.Read(fbuf, 0, 2048); } cs.Close();
// new code
int lineLength = 76; char[] CRLF = {(Char)13 , (Char)10}; num = cs.Read(fbuf, 0, lineLength); while(num > 0) { con.SendData(Encoding.ASCII.GetChars(fbuf, 0, num), 0, num); con.SendData(CRLF, 0, 2); num = cs.Read(fbuf, 0, lineLength); } cs.Close();
you can also modify the buffer size to 76 on line 530
this limits the line length to 76 chars and the attachment goes through ok
Patrick B.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
hi all,
how to send images with in the body of mail .. not as attachment.. can any body help...
byeeeeeeeeeeeeee sree
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
hello, its better to set the dateformat in rfc format: Tue, 11 Oct 2005 01:47:12 +0200
this worked for me:
//set headers con.SendCommand("DATA"); con.SendCommand("X-Mailer: smw.smtp.SmtpEmailer"); DateTime today = DateTime.Now; buf.Append("DATE: "); buf.Append(today.ToString("r").Replace("GMT","+0200"));
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
When we put some iso-8859-1 ponctuation like áéíóú the subject arrives at the destiny like ?????
|
| Sign In·View Thread·PermaLink | 4.20/5 (2 votes) |
|
|
|
 |
|
|
In SmtpConnection Class I replaced the ASCII encoding by ANSI (the default). It worked for me.
//OLD CODE//
internal void Open(string host, int port) { try { if (host == null || host.Trim().Length == 0 || port <= 0) { throw new System.ArgumentException("Invalid Argument found."); } socket.Connect(host, port); reader = new StreamReader(socket.GetStream(), System.Text.Encoding.ASCII); writer = new StreamWriter(socket.GetStream(), System.Text.Encoding.ASCII); connected = true; } catch (Exception ex) { throw ex; } }
//NEW CODE//
internal void Open(string host, int port) { try { if (host == null || host.Trim().Length == 0 || port <= 0) { throw new System.ArgumentException("Invalid Argument found."); } socket.Connect(host, port); reader = new StreamReader(socket.GetStream(), System.Text.Encoding.Default); writer = new StreamWriter(socket.GetStream(), System.Text.Encoding.Default); connected = true; } catch (Exception ex) { throw ex; } }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi @ all!
In the past some emails I sended came back with the error "Syntax error in address headers". After searching a long time (!) I found the cause. The email addesses you are sending to are comma-seperated: <1a.b@c.de>,<2a.b@c.de>,<3a.b@c.de> - check out http://cr.yp.to/immhf/recip.html[^] .
That's why I replaced the existing semicolon with comma:
buf.Append("To: "); buf.Append(to[0]); for(int x = 1; x < to.Count; ++x) { buf.Append(","); buf.Append(to[x]); } con.SendCommand(buf.ToString()); if(cc.Count > 0) { buf.Length = 0; buf.Append("Cc: "); buf.Append(cc[0]); for(int x = 1; x < cc.Count; ++x) { buf.Append(","); buf.Append(cc[x]); } con.SendCommand(buf.ToString()); }
if(bcc.Count > 0) { buf.Length = 0; buf.Append("Bcc: "); buf.Append(bcc[0]); for(int x = 1; x < bcc.Count; ++x) { buf.Append(","); buf.Append(bcc[x]); } con.SendCommand(buf.ToString()); }
Greetings! Sebastian.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
I send mail with image file by 'As inline HTML Image'. I thought it means the image shows in mail not attachment. But, I can't see the image in it.
I received the mail without image file.
Do I have to do setting for this program?
Anyway, Thank you,,,
this program is very good...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
You need to send the e-mail as HTML and place an img tag inside that points to the image.
<img src="cid:MY_FILENAME_WITHOUT_EXTENSION">
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
<img src="cid:MY_FILENAME_WITHOUT_EXTENSION">
i put my my image but still the image cant see can you give an example with an image name
my image attached is DIC101.JPG how should i give it in my html mail
i had given like this
<img src="cid:DIC101">
but image is not not displayed with the html
please help
Sanish
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I noticed you can view the BCC email addresses in the email header.
when I remove the following code in SmtpEmail.cs it is gone, but I can still receive bcc mails
if(bcc.Count > 0) { buf.Length = 0; buf.Append("BCC: "); buf.Append(bcc[0]); for(int x = 1; x < bcc.Count; ++x) { buf.Append(";"); buf.Append(bcc[x]); } con.SendCommand(buf.ToString()); }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi!
I tested the library in different ways. It seems to be very safe. But after turning on a Spam filter at my Email account I saw that the Emails not passed anymore. I fixed (till now) 3 scored points of search, which takes Emails to Spam Mails:
1. NO_REAL_NAME: ------------------------ The filter looks for Name and Email address in the 'From:'-line. The library do not support this. To fix this, you should declare another property say 'FromName' in the SmtpEmailer.cs and extend (go to the point where you build the headers) 'buf.Append("FROM: ");buf.Append(from);'. You get something like this: 'buf.Append("FROM: " + from_name + "<");buf.Append(from + ">");'. This solves the first not high scored Spam filter search point.
2. INVALID_DATE: ------------------------ This one applies to all who use other system languages than (US) English, e.g. myself. My system setting is German. The library build a header for date: 'DateTime today = DateTime.Now;buf.Append("DATE: ");buf.Append(today.ToLongDateString());'. This affects in sending a No-Standard-Date. Standard would be 'Tue, 05 Apr 2005 22:26:58 (GMT)' or 'Tue, 05 Apr 2005 22:26:58 +0200'. I get at this point 'Dienstag, 5. April 2005'. I modified this as follows: 'DateTime today = DateTime.Now;string strToday = today.ToString("r");strToday=strToday.Replace(strToday.Substring(strToday.Length-3,3),"+0200");buf.Append("DATE: ");buf.Append(strToday);'. Now I get a standard date format for this Email header.
3. RATWARE_HASH_2_V2 ------------------------ This is a very high scored search point and belongs to the header 'X-Mailer'. I would not swear to that, but I think the spam filter software goes through a list with known Email software names and if the name you specify at 'con.SendCommand("X-Mailer: smw.smtp.SmtpEmailer");' do not match this list... I don't know another solution but: '//con.SendCommand("X-Mailer: smw.smtp.SmtpEmailer");'. (This header is optional).
MIME_BASE_64_BLANKS (Extra blank lines in base64 encoding): High scored, No solution. BAYES_00 (Bayesian spam probability is 0 to 1%): No solution.
Every comments are welcome! Sebastian.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hello Sebastian, Did you mead original library posted by Steaven Woyan or updated version by Alexander Kojevnikov?
To ALL: Please, make the note what library version do you mean. Probably it has good idea to create resume of resolved/open issues about that library since it was updated by Alexander Kojevnikov at 11 Jul '04. http://www.codeproject.com/csharp/smtpemailer.asp?df=100&forumid=4075&exp=0&fr=26&select=872597#xx872597xx
Thank you, Denis
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Denis,
I tried the most updated version at this time but I can not say which version this was on 5 Apr 2005! Sorry! By the way I would say it concerned both.
Sebastian.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
Hi,
It would be nice to get back some error messages if an email were not sent (e.g. if the connection can not be opened or a bad login password has been sent). Is this simply possible?
Thank you! Many greetings! Sebastian.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |