[Mono-list] Sending email via gmx in C#

2010-02-17 Thread pfj

Hi,

Currently my code looks like this

void SendClick(object sender, EventArgs e)
{
string un = uname + @ + address;
string ipa = IP address sent from :  + ip.Text;
StreamWriter sw = new StreamWriter(@h:/test.txt);
sw.WriteLine(name);
sw.WriteLine(un);
sw.WriteLine(mess);
sw.WriteLine(ipa);
sw.Close();

MailMessage mail = new MailMessage();
mail.To.Add(p...@foundationcampus.com);
mail.From = new System.Net.Mail.MailAddress(un);
mail.Subject = A quick test;
mail.Body = Just a quick test to make sure this works;
mail.Attachments.Add(new Attachment(@h:/test.txt)); 
System.Net.Mail.SmtpClient smtp = new
System.Net.Mail.SmtpClient(mail.gmx.com);
smtp.EnableSsl = true;
smtp.Credentials = new 
System.Net.NetworkCredential(usern...@gmx.com,
password);
try
{
smtp.Send(mail);
}
catch (System.Net.Mail.SmtpException ex)
{
MessageBox.Show(ex.Message.ToString(), 
Ouchy!!!,
MessageBoxButtons.OK);
}
}

This should work happily, but I always get an error thrown -

Mailbox unavailable. The server response was 5.7.0 Sender address does not
belong to logged in user {mp-eu001}

According to the docs for gmx, I'm doing this correctly.

Is my code wrong or is there something else I need to do for gmx to play
ball?

Thanks

Paul
-- 
View this message in context: 
http://n4.nabble.com/Sending-email-via-gmx-in-C-tp1558501p1558501.html
Sent from the Mono - General mailing list archive at Nabble.com.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Sending email via gmx in C#

2010-02-17 Thread Robert Jordan
On 17.02.2010 12:04, pfj wrote:
 This should work happily, but I always get an error thrown -

 Mailbox unavailable. The server response was 5.7.0 Sender address does not
 belong to logged in user {mp-eu001}

 According to the docs for gmx, I'm doing this correctly.

 Is my code wrong or is there something else I need to do for gmx to play
 ball?

GMX does not allow sending of mails with a sender address !=
the gmx email address, unless you're a paying customer.

So you better assure that 'un = uname + @ + address;'
is actually building a valid gmx e-mail address matching
the account you're sending mails from.

Robert

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Sending email via gmx in C#

2010-02-17 Thread pfj

Hi,

I've got a valid gmx email address that I can send from my google account to
the gmx one (or even my work email to gmx). According to the set up for
thunderbird, the smtp needs usern...@gmx.com and a password. In my code
they're both valid, yet I'm still unable to send.

Am I missing something?

TTFN

Paul
-- 
View this message in context: 
http://n4.nabble.com/Sending-email-via-gmx-in-C-tp1558501p1558655.html
Sent from the Mono - General mailing list archive at Nabble.com.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Sending email via gmx in C#

2010-02-17 Thread A.M. Abdelaziz
it's said that port 25 is the default, but u r using ssl
have u tried seting smtp.port = 465

On Wed, Feb 17, 2010 at 3:28 PM, pfj pjohns...@uclan.ac.uk wrote:


 Hi,

 I've got a valid gmx email address that I can send from my google account
 to
 the gmx one (or even my work email to gmx). According to the set up for
 thunderbird, the smtp needs usern...@gmx.com and a password. In my code
 they're both valid, yet I'm still unable to send.

 Am I missing something?

 TTFN

 Paul
 --
 View this message in context:
 http://n4.nabble.com/Sending-email-via-gmx-in-C-tp1558501p1558655.html
 Sent from the Mono - General mailing list archive at Nabble.com.
 ___
 Mono-list maillist  -  Mono-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-list




-- 
A.M. Abdelaziz
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Sending email via gmx in C#

2010-02-17 Thread Robert Jordan
On 17.02.2010 14:28, pfj wrote:

 Hi,

 I've got a valid gmx email address that I can send from my google account to
 the gmx one (or even my work email to gmx). According to the set up for
 thunderbird, the smtp needs usern...@gmx.com and a password. In my code
 they're both valid, yet I'm still unable to send.

 Am I missing something?

Yes, you didn't read my response. Being able to send a mail from
Google to GMX means nothing in this context.

Again: GMX *requires* that the FROM address is a GMX address. This
means that you MUST NOT send a mail FROM 'pjohns...@uclan.ac.uk'
via GMX' servers. The FROM address MUST be 'someth...@gmx.com',
the account/login name MUST be 'someth...@gmx.com' and the
password MUST match.

All capitalized words as per RFC-2119 ;)

Robert

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list