john wen

Hello
I wrote the following email program for sending email. However after running the following email program, I still could not see that received email from my email account. Where is the problem Please help.

John Wen
5 - July - 07
=====================================================
using System;
using System.Net.Mail;

public class myemail_send
{

public static void Main(string[] args)
{
try
{
MailAddress maFrm = new MailAddress("johnwen604@yahoo.com.hk",args[0],System.Text.Encoding.UTF8);
MailAddress maTo = new MailAddress("johnwen604@yahoo.com.hk");

MailMessage message = new MailMessage(maFrm, maTo);
message.Subject = "Hi how are u ";
message.Body = "hi I am a boy and you are a girl. I hope you are well. Bye! Bye!";
SmtpClient client = new SmtpClient(args[1]);
client.Send(message);
} catch (IndexOutOfRangeException e)
{
Console.WriteLine("Usage : send <sender name> <SMTP Server>");
}
}

}
=================================================================



Re: .NET Framework Networking and Communication About sending email problem (No received email from my email account)

Evan H

Realize that if your program seems to work as expected, it may not be your program. A lot of the major email providers (yahoo included) use various spam filters. This includes checking the IP address on all email sent to their servers. I would say that it's very likely you are getting filtered by yahoo.

Try changing the From address to something other than your Yahoo account (something valid and real, but not yahoo). An email address from a personal or work domain would be best.






Re: .NET Framework Networking and Communication About sending email problem (No received email from my email account)

john wen

Hello

I have tried another email provider than yahoo such as gmail. But the problem is still existing that is no received email from my gmail email account. What do you suggest me to do

John Wen
5 - July - 07





Re: .NET Framework Networking and Communication About sending email problem (No received email from my email account)

Evan H

I suggest you try a non-free email provider.




Re: .NET Framework Networking and Communication About sending email problem (No received email from my email account)

TaylorClark

Hey John, I had a similar problem and I found that my outgoing mail server required authentication. You may need to specify your login name and password before invoking SmtpClient:: Send(). Try something like this:

Code Snippet

SmtpClient client = new SmtpClient(args[1]);
smtp.Credentials = new NetworkCredential("johnwen604@yahoo.com.hk", "YOUR_LOGIN_PASSWORD");
client.Send(message);



I don't have too much experience with SMTP programming, but I know some mail servers will not act as relays (http://en.wikipedia.org/wiki/Open_mail_relay), meaning you can't send an e-mail from your account unless you are on the host's network. Also, from a cursory search:
http://help.yahoo.com/l/us/yahoo/mail/original/mailplus/pop/pop-30.html
It looks like you may not be able to send Yahoo e-mail unless you are a Mail Plus customer. Good luck.