Hello
Iam sending mail from web page like, enquiry form mail using asp and asp.net.while send the mail i don't have any error.
but the mail does't reach the destination.can some one give me a solution for this problem.

ds

1.Make sure your SMTP server path is correct.
2.This may be absurd but check your Bulk folder.Often the mail you send goes to the Bulk folder.
3.Paste your code,if you still arent able to solve the issue.

code

Dim objMessage As New MailMessage
objMessage.From = "from@test.com"
objMessage.To = "test@test.com"
objMessage.Subject = "subject"
objMessage.Body = "MailBody"
objMessage.BodyFormat = MailFormat.Html
'Optionally set to external SMTP Server
SmtpMail.SmtpServer = ""
SmtpMail.Send(objMessage)

i haven't given the smtp server.i want to send from one server to another.
please help me out.

Member Avatar for Geek-Master

I tried the code and it doesn't work for me either.

I've tried 2 different external SMTP servers and both didn't send any mail.

IIS has a built in SMTP server it will use if you don't supply an SmtpServer String

I'm Positive that there aren't any Firewalls blocking SMTP on any of my routes.

The code I have from "Osborne's - The Complete Reference of ASP.NET" doesn't supply any information other than an example of using System.Web.Mail Methods

Is there anything that might prevent sending any mail?

Member Avatar for Geek-Master

I was able to fix my problem with getting ASP.NET to send emails.

I looked into my "badmail" folder located in "C:\Inetpub\mailroot\Badmail" and found this error

Unable to deliver this message because the follow error was encountered: "Error is processing file in pickup directory.".

The specific error code was 0xC00402CE.

I found help at Microsoft's website at http://support.microsoft.com/default.aspx?scid=kb;en-us;319285

Which talked about the .FROM property was bad and you might need to make sure that the From email address is a valid email address.

The other problem is that I wasn't Granted to Relay messages.

Which you need to start IIS >> Right Click your SMTP Virtual Server >> Select Properties >> Select the Access Tab >> Click the Relay... button >> Uncheck "Allow all computers which successfully..." checkbox >> Then Add 127.0.0.1 "local IP address" to the list above the checkbox.

I hope that any of this can help future situations.

Hi all,
I found this above post to be specific for my issue. how can i be sure whether my SMTP virtual server is configured properly ? If its not, then how to do it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.