Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Sending Mails to external domains in .net 1.1

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rose - 03 Mar 2008 09:17 GMT
Hi everyone,

I have been searching the net but couldnt find a solution to my
problem of sending emails to external domains in Asp.net 1.1.

I am not getting any error and the Mail Send message returns 1 or
success but the mail doesnt go. I am using the Mail Server as the
Companies Exchange Server which has full rights to send emails to any
domain. This is proved by the fact that if I sent email through
outlook to hotmail,gmail etc , it works fine. Also I have created a
user in the Exchange Server will full rights but still the problem
persists. I have copied my code below to give you an idea.

MailMessage objMsg = new MailMessage();

    objMsg.From ="abc@xyz.com";
    objMsg.Subject = objMailDM.MailSubject;
    objMsg.Body += objMailDM.MailBody;
    objMsg.To ="123@xyz.com";

    SmtpMail.SmtpServer =
ConfigurationSettings.AppSettings["MailServer"]; //this entry will go
to web.config
    // set SMTP server port
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
smtpserverport",25);
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
sendusing",2);
//objMsg.BodyFormat = System.Web.Mail.MailFormat.Html;
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
smtpauthenticate",1);
objMsg.Fields.Add"http://schemas.microsoft.com/cdo/configuration/
sendusername", "username");
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
sendpassword", "pass");
                try
                {
                    SmtpMail.Send(objMsg);
                    return 1;
                }
ThatsIT.net.au - 03 Mar 2008 10:25 GMT
your code looks like cdo using in classic asp.

try something simple like

Dim message As New MailMessage("sender@address", "from@address", "Subject",
"Message Text")

Dim emailClient As New SmtpClient("Email Server Name")

emailClient.Send(message)

> Hi everyone,
>
[quoted text clipped - 36 lines]
> return 1;
> }
sloan - 03 Mar 2008 20:21 GMT
Go here
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry

download the code.

This will give you a pretty good baseline to test against.

I've "grouped together" the germane cdo properties fairly well too.

But it is 1.1 code for sending emails.

Try to get my code working (by changing some config file settings) BEFORE
trying to cut and paste out code you think you need.
(or better yet, keep it as a library)

> Hi everyone,
>
[quoted text clipped - 36 lines]
> return 1;
> }
rose - 04 Mar 2008 09:13 GMT
Thanx...After trying all the solutions available over the net, I ended
up with the above code and it is actually working fine. I finally got
it running but the mails to hotmail and google took some time to reach
making me think that the code didnt work.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.