954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Sending mails......

Hello!

I had problem sending mails through asp.net, even after writing the code.
But after providing the IP address of my pc in the relay option in IIS, the problem finally got solved.


But now the problem is that the same code when I tried to run on a pc which was a local server, I still face the problem.

I write the follwing code
dim mm as new mailmessage
mm.to="rasvinder.soodan@gmail.com"
mm.from="rasvinder.soodan@gmail.com"
mm.subject="hello"
mm.body="hello"
mm.priority=priority.high
smtpmail.smtpserver="theip addrss of the local machine"
smtpmail.send(mm)


The above code runs succesfully on one pc, which is a normal client pc, but when run on a server machine, mail are not sent.

Can u plz help me out?


Thanks

nice_true
Light Poster
28 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

set smtpClient.host property

write the name of server in smtpClient.host

priyankaagrawal
Newbie Poster
21 posts since Feb 2007
Reputation Points: 10
Solved Threads: 1
 

Hello to you
I'll just give you a sumary of what I did in a very similar scenario.

Dim oMsg As New CDO.Message
        Dim iConfig As CDO.IConfiguration
        Dim oFields As ADODB.Fields
        Dim oField As ADODB.Field


        Dim strEmailAddress As String = "jobstar@yahoo.co.uk"
        Dim strSubject As String = "Request  for missions"
        Dim msgMail As String = "Pls Find below the details. Thank You."

        iConfig = oMsg.Configuration
        oFields = iConfig.Fields
        ' Set configuration.
        'using the local smtp server
        oField = oFields("http://schemas.microsoft.com/cdo/configuration/sendusing")
        oField.Value = 1
        oFields.Update()

        Try

            'message()
            oMsg.TextBody = msgMail
            oMsg.Subject = strSubject

            oMsg.From = "terrastar@comstar.net"
            oMsg.To = strEmailAddress
            oMsg.Send()

        Catch x As Exception
        Finally

        End Try

Then on the server uncheck the 'allow all computers which successfully authenticate to relay regardless of the list above'

This should work. It worked for me. If any problems please get back to me.Hello!

I had problem sending mails through asp.net, even after writing the code.
But after providing the IP address of my pc in the relay option in IIS, the problem finally got solved.


But now the problem is that the same code when I tried to run on a pc which was a local server, I still face the problem.

I write the follwing code
dim mm as new mailmessage
mm.to="rasvinder.soodan@gmail.com"
mm.from="rasvinder.soodan@gmail.com"
mm.subject="hello"
mm.body="hello"
mm.priority=priority.high
smtpmail.smtpserver="theip addrss of the local machine"
smtpmail.send(mm)


The above code runs succesfully on one pc, which is a normal client pc, but when run on a server machine, mail are not sent.

Can u plz help me out?


Thanks

jamello
Posting Whiz in Training
219 posts since Oct 2006
Reputation Points: 215
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You