473,796 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SMTP Email not working

3 New Member
I am sending a email with a HTML body from my VB.NET application using SMTP protocol. I am facing a problem when i send a long HTML text as body. Its working perfectly with small HTML body. But that same long HTML body mail is working perfectly from a XP server and IIS 5.0. If host the same application in IIS 6.0 and windows 2003 server, this problem popsup.

Here is my mail setting section in the web.config

<system.net>
<mailSettings >
<smtp from="traveldes k@company.com" >
<network host="mail.host .com" port="25" userName="usern ame" password="passw ord" defaultCredenti als="true"/>
</smtp>
</mailSettings>
</system.net>


Here is my code for sending the mail.


Public Sub Send()
Try
vBody = "<html> <body>" & vBody & "</body> </html>"
If (vMailId.Trim() .Length > 0) Then
Dim Message As New System.Net.Mail .MailMessage(vF romAddress, vMailId, vSubject, vBody)
Dim Mail As New System.Net.Mail .SmtpClient()
Message.IsBodyH tml = True
Message.ReplyTo = New System.Net.Mail .MailAddress("m ai@company.com" )
Message.Deliver yNotificationOp tions = Net.Mail.Delive ryNotificationO ptions.Delay Or Net.Mail.Delive ryNotificationO ptions.OnFailur e Or Net.Mail.Delive ryNotificationO ptions.OnSucces s
If ((Not vAttachFile Is Nothing) AndAlso vAttachFile.Tri m().Length > 0) Then
If (System.IO.File .Exists(vAttach File)) Then Message.Attachm ents.Add(New System.Net.Mail .Attachment(vAt tachFile))
End If

Mail.Send(Messa ge)
End If
Catch ex As Exception
Throw ex
End Try
End Sub
Aug 6 '07 #1
9 3649
kenobewan
4,871 Recognized Expert Specialist
What is the error message and which line? Are you sure this worked perfectly before?
Aug 6 '07 #2
Plater
7,872 Recognized Expert Expert
If you set the isBodyHTML to True, are you supposed to put those <html> tags in there? Or does the mail message add them automatically?
Then you would get like:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3.  
  4. <html>
  5. <body>
  6. [your text]
  7. </body>
  8. </html>
  9.  
  10. </body>
  11. </html>
  12.  
Aug 6 '07 #3
SREEDEV
3 New Member
What is the error message and which line? Are you sure this worked perfectly before?
Yeah, this was working properly in XP server with IIS 5.1, but in the production server which is windows 2003 and IIS 6.0, it is not working. And there is no error as such, when i debug the line (mail.send()) is executed with out any error but the receiver is not getting the mail. He/she will get the mail only if the body is a small text (10-12 characters). if there is a <br> tag in the body, again the receiver is not getting the mail.
Aug 6 '07 #4
SREEDEV
3 New Member
Can anyone help me out ???????.
Aug 7 '07 #5
Floydan
24 New Member
Have you checked to see if the IIS server allows 127.0.0.1 to send emails in the SMTP Relay option?
Aug 7 '07 #6
Plater
7,872 Recognized Expert Expert
Theres no issues with it getting flagged junk mail and stuff is there?
Outlook auto-flags anything with a plain IP address as junk mail (for me, I haven't seen how to stop it yet)
Aug 7 '07 #7
Floydan
24 New Member
Have you checked to see if the IIS server allows 127.0.0.1 to send emails in the SMTP Relay option?
Setting this option will tell the SMTP server to accept calls from "itself" this was an issue at my former company and something they forgot to check everytime they set up a new server.
Aug 8 '07 #8
renjucool
15 New Member
Setting this option will tell the SMTP server to accept calls from "itself" this was an issue at my former company and something they forgot to check everytime they set up a new server.

You need Microsoft exchange server to relay mails to outside
Aug 8 '07 #9
Plater
7,872 Recognized Expert Expert
You need Microsoft exchange server to relay mails to outside
What is the OP was using an outside mailserver?
I use the mail server that handles my company's email. (We outsource to someone else)
Aug 8 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
7487
by: Pedro | last post by:
Hi all, a friend using Windows wanted to send mail, but he got timeout errors after editing php.ini Mail section smtp = smtp.server.com sendmail_from = friend@server.com I realized that was because of the need to "POP before SMTP", so I made him a function. It's working ... for his server (and
6
3837
by: Fernando M. | last post by:
Hi, i made a test with smtplib module a few days ago, for sending mails, and i was wondering if there's another module for running an SMTP server, so i could make a standalone script for sending mails without using an external SMTP server. I've been searching but i'm not sure if there are modules for it, or anything. Which ones are my options? Thanks.
1
8042
by: bivin | last post by:
hai i am requesting your technical support. please help me. i have been working with this for five days. the problem is relating with the smtp. i am trying to send an email from the asp.net page. earlier it was showing send using not find error.
9
4312
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5, VisualStudio2002, VB as programing language. Our test/development version of the web app as hosted on our "localhost" works fine; our "Default SMTP Virtual Server" is running (per the IIS console).
5
2501
by: Charlie | last post by:
Hi: I'm working on an e-commerce site. Using the SMTP class, my site sends out confirmation messages. It works most of the time, but sometimes raises an error. I need a way of making sure it goes out every time. I thought about wrapping a try-catch handler in loop that keeps on retrying if delivery fails. Is this a good idea? If not, what is the best way of handling this kind of thing? Thanks,
1
2957
by: Benny Ng | last post by:
Dear All, Now I just finished my winform application. And a part of that is to send email reminder to the users. It's working fine in the server that with SMTP service in Windows 2003. But now the user wants to used the Linux server to send email messages. (already installed the SMTP service in that). Unfortunatelly one error shown after the sending funciton invoked. It shows "Pickup directory is not existed,x,x,x,,"
11
2726
by: ibiza | last post by:
Hi all, I am trying to use the System.Net.Mail class for the first time, with ASP.NET 2.0. I setup everything according to http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives me a working environment for sending mails. I am sure the code is correct, there are no errors and everything seems
5
5090
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi, I'm using this code for sending emails and its working fine because I had configured SMTP in my machine in IIS. now I'm using machine as a server for this application. but when running the same application from other machine the email process is not working. so, do I have to configure and install SMTP in all client machine to get it working!? or should it be enough just to set it in the server machine?
3
3301
by: tamaker | last post by:
I have Road Runner cable internet access and Im working in a local development environment (writing .ASP) and have a site running on my network on a windows xp pro machine via IIS with CDONTS installed. When I try to send a confirmation email (simple text) via CDONTS the message is built but remains on the server in the QUEUE folder ... how can I tweak the SMTP settings on the server to allow me to send email out from the server... ...
5
5305
by: jimhill10 | last post by:
I have a perl script that creates an email attachment file from POST data on a web page. This works just fine. I want to customize the email body to contain all of the text data from the file itself. I thought this would be just a matter of using the $smtp->datasend($POSTvalues) with the $values coming from the names on the web page posting the data. Can someone show me what the correct code snippet would be? Here is my code: ...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10465
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10242
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10200
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5453
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.