Hi, i am creating a legitimate email program which sends emails to people in the database. I can also, add a custom email recipient if the user requires it. So I try to email my hotmail account from my program. I set the SMTP server to my works local SMTP server and I use my valid work email address as the from Email Address. This works for most email addresses. However, it seems it will not send to hotmail. I get an error "5.7.1 Unable to relay for email@hotmail.co.uk". I did some research on this and there are suggestions that hotmail thinks i am a spammer and is telling me to go away.
So, my next test was I email my hotmail account from outlook. I put the recipient email address in. The From Email Address is already setup in outlook (same as I inputted into my program). This email then sends.
Does anyone know what I need to do to send to hotmail?
Maybe there’s a way to validate the email address? Some sort of authentication with the server?
Any help on this is much appreciated,
Thanks,
Piercy
7 1667
Bump, anyone got any ideas? Heres the code im using to send the email. Im currently catching the error and returning 5 so ican return the info to the user. -
private short SendEmail(string FromEmail, string ContactEmail,string Subject, string Message, ArrayList Attachments)
-
{
-
//populate message
-
MailMessage objMsg = new MailMessage(FromEmail, ContactEmail, Subject, Message);
-
-
//do attachments
-
foreach (string path in Attachments)
-
{
-
//Add Attachment to attachmnt Array
-
Attachment data = new Attachment(path);
-
objMsg.Attachments.Add(data);
-
}
-
-
//Point to SMTP server d[-_-]b
-
SmtpClient SmtpMail = new SmtpClient(SMTPIP);
-
-
// Start Sending Process
-
try
-
{
-
SmtpMail.Send(objMsg);
-
}
-
catch(System.Exception ex)
-
{
-
ex.ToString();
-
return 5;
-
}
-
return 0;
-
}
-
Have you tried sending your credentials to your own smtp server?
A lot of times what you can do is limited on the SMTP Server unless you authenticate with it. Do all the authentication business and see if it gives different results.
Have you tried sending your credentials to your own smtp server?
A lot of times what you can do is limited on the SMTP Server unless you authenticate with it. Do all the authentication business and see if it gives different results.
-
System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential("Username","Password");
-
//Point to SMTP server d[-_-]b
-
SmtpClient SmtpMail = new SmtpClient(SMTPIP);
-
-
// Start Sending Process
-
try
-
{
-
SmtpMail.Credentials = SMTPUserInfo;
-
SmtpMail.Send(objMsg);
-
}
-
Thanks for your reply however it didnt change my problem. The information im giving it is correct. I just checked it by telnetting(is that a word) the server and doing AUTH LOGIN. I then passed the base64 encoding of my username and password and it said it authenticated.
Any other ideas or am i doing something wrong?
Thanks again,
Piercy :)
I agree with Plater your email is not sending the right credentials. Credentials are not just username and password. View the headers of both emails and you will see the difference. Hotmail is correctly trying to block programs that flood its users with spam. Unfortunately for you, your current emails fall into this category. Websites generally use methods that do not create this problem - spammer programs/code do.
I agree with Plater your email is not sending the right credentials. Credentials are not just username and password. View the headers of both emails and you will see the difference. Hotmail is correctly trying to block programs that flood its users with spam. Unfortunately for you, your current emails fall into this category. Websites generally use methods that do not create this problem - spammer programs/code do.
Heres the header code from my application: (ive edited it cos i dont know what information is should give out on here so email changes and a few random digits thrown in Message id) -
x-sender: anotherEmail@bits.uk.com
-
x-receiver: myEmail@bits.uk.com
-
X-SCL: 7 92.13%
-
Received: from pc_name ([100.100.100.100]) by someserver.bits.uk.com with Microsoft SMTPSVC(6.0.3790.3959);
-
Wed, 27 Feb 2008 13:46:40 +0000
-
mime-version: 1.0 from: anotherEmail@bits.uk.com
-
to: myEmail@bits.uk.com
-
date: 27 Feb 2008 13:46:40 +0000
-
subject: Hii
-
content-type: text/plain;
-
charset=us-ascii
-
content-transfer-encoding: quoted-printable
-
Return-Path: anotherEmail@bits.uk.com
-
Message-ID: <someserverjhhjg3FcDXAar00000a97@someserver.bits.uk.com>
-
X-OriginalArrivalTime: 27 Feb 2008 13:46:40.0328 (UTC) FILETIME=[2E1BEC80:01C87947]
-
Then heres a similar email sent from within outlook. -
X-Message-Delivery: Vj0asszLjQuMDt1cz0wO2k9MdfderDtsPTA7YT0x
-
X-Message-Status: n:0
-
X-SID-PRA: My Name <myEmail@bits.uk.com>
-
X-Message-Info: JfgfgGTYoYF78jGA4cGI+uAYMekE5VAgcFITnOMggSU/9YSFaWKr+doBv4IgPK3pMwL+Ut2S9MkmZCS9MsR5G5OM/WyIMhgPn7MESt
-
Received: from anchor-post-32.mail.host.net ([1.1.1.1]) by bay0-mc1-f11.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444);
-
Mon, 25 Feb 2008 06:50:10 -0800
-
Received: from mailarea.bits.uk.com ([111.111.111.111] helo=someserver.bits.uk.com)
-
by anchor-post-32.mail.host.net with esmtp (Exim 4.67)
-
id 1JTeef-000Jx5-8U
-
for myEmail@hotmail.co.uk; Mon, 25 Feb 2008 14:50:09 +0000
-
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133
-
Content-Class: urn:content-classes:message
-
MIME-Version: 1.0
-
Content-Type: multipart/alternative;
-
boundary="----_=_NextPart_001_01C877BD.FF4ECBDC"
-
Content-Transfer-Encoding: 7bit
-
Subject: TEST EMAIL FROM meee
-
Date: Mon, 25 Feb 2008 14:52:09 -0000
-
Message-ID: <69ECAE5F4AB2DE48A0DDA9C59BDFRWE62AEE41F0C6D@someserver.bits.uk.com>
-
X-MS-Has-Attach:
-
Importance: normal
-
Priority: normal
-
X-MS-TNEF-Correlator:
-
Thread-Topic: TEST EMAIL FROM meee
-
thread-index: Ach3vf++pCS4fWpMSuWTLCA1rzjpjQ==
-
From: "My Name" <MyEmail@bits.uk.com>
-
To: <myEmail@hotmail.co.uk>
-
Return-Path: myEmail@bits.uk.com
-
X-OriginalArrivalTime: 25 Feb 2008 14:50:11.0047 (UTC) FILETIME=[B8A5FF70:01C877BD]
-
Thing is when i send an internal email from outlook there are no headers. so ive sent from outlook to my hotmail.. i know theres a lot different but i dont understand how i might change my code to fix this?
Thanks again,
Piercy
Did you try putting the authentication stuff into the SMTPServer object in your C# code?
Did you try putting the authentication stuff into the SMTPServer object in your C# code?
Yes, also, while trying to solved this. i discovered that firstly, yahoo didnt work either. Secondly, i changed my smtp server address to our ISP's server and it worked. So we have come to the conclusion its the smtp server rather than my code.
We going to get our guys to look at it...
Thanks for your help :)
Piercy
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Philippe Reynolds |
last post by:
Hi,
I'm learning python...one of my tasks is to send out emails...
I can send emails to one person at a time but not as groups....
Do you think you can help.
Cheers
Philippe Reynolds
|
by: Bob-O |
last post by:
Need your help in sending an email message with an attachment in my VB.Net program. Sending a body message is no problem. I don't know how to use the attachment property in an emai
Following is...
|
by: Özden Irmak |
last post by:
Hello,
In my application, I've to cast DocumentDesigner class to my own derived
class,MyDocumentDesigner, in order to reach the protected properties in
DocumentDesigner class. But everytime I...
|
by: tafs7 |
last post by:
My code below is supposed to email me when an error occurs on the
application, but it's not emailing anything. Am I missing something?
I know the smtp servers I've tried work. I even added a...
|
by: Franck |
last post by:
Hello,
are they any way fo sending an email wihtout
defining the sender?
thanks
|
by: Shaan |
last post by:
Hi Everybody,
I am incorporating emailing feature in my VB.Net
application. The code is as below. When I send email to
some XYZ@buffalo.edu, it sends the email successfully,
but when I send it...
|
by: Pieter |
last post by:
Hi,
I'm having some weird problem using the BackGroundWorker in an Outlook
(2003) Add-In, with VB.NET 2005:
I'm using the BackGroundWorker to get the info of some mailitems, and after
each item...
|
by: crescent_au |
last post by:
hi all,
i have this mail() function which works fine but i've tested it with
hotmail where i use hotmail email address for sender and receiver also
hotmail. If I type in a not existent email...
|
by: paul814 |
last post by:
I've been working on this for some time now and have gotten
nowhere...hoping someone here can help.
I want to take and email all records in a database for the current
date when this php page is...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |