Mail.SMTPClient send error
Hi, I am getting a random NullReferenceException - Object reference not set to an instance of an object.
I cannot reproduce it in my test environment and my users only get it occasionally.
The problem is that the Stack Trace does not point to a line within our code and the entire method is wrapped up in a try catch but the exception is never caught...!
I have narrowed it down to the smtpclient.send(object) method but have no idea how to diagnose the problem further.
Anyone else had this got a solution or any idea as to how I can find out where the problem is?
NB a user can try exactly the same operation using the same parameters and it usually works, it is about 1 in 20 that it fails.
The fact that I am unable to trap it makes it impossible for me to see what the problem is and as this is the code behind in an aspx web page it leaves the users with a nasty screen in front of them...
Heyelp?
Hello WldgDevelopment,
>>The problem is that the Stack Trace does not point to a line within our code and the entire method is wrapped up in a try catch but the exception is never caught...!
If in your project, you use the Exception class to handle all exception, I suggest that you could have a try to use the
NullReferenceException in the try-catch-finally block:
https://msdn.microsoft.com/en-us/library/dszsf989(v=vs.80).aspx.
>>I have narrowed it down to the smtpclient.send(object) method but have no idea how to diagnose the problem further.
Since you have located the caused method and it is a .NET method, I suggest you could check this blog:
http://blogs.msdn.com/b/dotnet/archive/2014/02/24/a-new-look-for-net-reference-source.aspx, you could debug .NET source code according to it. And since the .NET is opensource, you could try to create a yourself
smtpclient.send(object) method and add some custom debug approaches to check which item causes this exception.
Regards,
Fred.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Similar Messages
-
Hi,
I need to use Mail Adapter Sender with MAPI protocol.
I have create my Comunication Channel of type IMAP4 and configured URL as mapi://server and actved one.
In RWB appears the message "mail client job stopped completly"
Can anybody help me?The URL must be: imap://server/inbox
This is hard coded in the mail adapter and cannot be changed.
Only imap4 and pop3 are supported.
Regards
Stefan -
When i click Yahoo mail, firefox is closing, says send error report or close
The new Yahoo Mail is updated, so when i open yahoo mail, the browser says " firefox encountered... error . Send error report or close". This is the error window dialogue box appear.
After that, the complete firebox browser closing, how do i open my yahoo mail.
GMail and other websites is working fine. The problem with only Yahoo mail.
Please help.
My important mail has to be read.See:
*https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding
*http://kb.mozillazine.org/Profile_in_use -
I'm getting this set of error messages intermittantly:
<P>
An error occured while sending mail: smtp server error
the server responded: (null) contact email admin
for assistance
other message
an error occured while sending mail: smtp server error
the server responded: intermail,
end with quote.quote contact email admin
for assistance
<P>
This problem may occur at low-use times when Messaging is installed with the
Trend virus protection software on the same system.
<P>
Change the version of the Trend software from 3.0 to the older 2.62 version.It's possible that your provider has made a change.
I think STARTTLS usually is used with port 587, instead of the standard SSL port 465.
Could you look up your provider's current SMTP settings to see whether your "Outgoing Server" settings need to be updated? If it's difficult to translate between your provider's help page and Thunderbird's dialog controls, you could provide a link to your provider's help page. -
Send Error Type or Description of failed messgaes in body of mail using SMTP adapter
Hi,
I want to send failed messages error type or description to admin to notify him for error occurs in BizTalk, with Error description in body part.
I have set Send port option for "Enable routing of failed messages" and created a send port having SMTP adapter. Now in body I want to send error description.
Pls advise how can I achieve this.
-- Kind Regards SandeepWhen failed message routing is enabled, BizTalk Server does not suspend the message—it routes the message instead.
When a failed message is generated, BizTalk Server promotes error-report-related message context properties and demotes regular message context properties before publishing the failed message. Compare this to the default behavior when
failed message routing is not enabled: Messages that fail are suspended. --------
MSDN
So if i were in this situation i would prefer to route the failed message to SMTP as well as to some kind of transport from which i can again receive the message ( like MSMQ or File).
I mean create a send port group and bind 2 send port to this group (SMTP and MSMQ) and bind this group to that orchestration (specified in previous post) which subscribe the Failed Messages. Then bind the MSMQ location to your receive
location to retry.
I am not sure wheather it is the optimal solution or not ..... but it will work. Kindly let me know if you are not clear with what i said.
Regards -
Yesterday I uploaded Yosemite 10.10.2 thinking it was fixed by now. In Mail, my POP account gets this error message: Mail cannot send your password securely to the server. You can remove this restriction in the Accounts preferences by setting “Allow insecure authentication”, which could put your password at risk.
My provider says it's an Apple issue. The gmail accounts are logging in fine. Any help? Something simple?
Thanks anyone.Thanks Csound1. That did work and Mail was able to connect to the internet. Green light status. Is it because of my provider that I may never have had secure connections? Is that an Apple thing or do PCs have the same issues? Appreciate your help. I'll research insecure connections as I am ignorant of the consequences.
-
Mail cannot send your password securely to the server. You can remove this restriction in the Accounts preferences by setting “Allow insecure authentication”, which could put your password at risk.
I have the same problem.
Late 2012 imac 27", intel i7 core
When I upgraded to Yosemite, suddenly my email account (netvigator POP) gives an error:
Mail cannot send your password securely to the server. You can remove this restriction in the Accounts preferences by setting “Allow insecure authentication”, which could put your password at risk.
I have shut down & restarted mail, but no success. If I select Allow insecure authentication, it works, but that's not a long term fix.
I also have a hotmail POP account enabled, and that is working fine.
What's happening Apple??
(Long term apple family - iMac, iBooks, TimeCapsule, iPhones, iPads, AirportExpress etc etc) -
How can I make mail retry sending messages in the Outbox?
Howdy all,
As the title says how can a force Mail to try to resend the messages in the outbox? I use my MacBook Pro in a number of different environments and when I am on one flakey access point in particular or when I have forgotten to open Safari to reauthorize recently on another network Mail will fail to contact the SMTP server. When this happens my message gets stuck in the outbox to be sent later. My problem is that I do not know how to get it out of there effectively.
Once I have fixed the transitive error in the network (or or the problem fixes itself) how do I get the messages out of the inbox? At this point I can send more messages with no problem and they will happily go out but those in the queue just sit there.
Now, I have tried a number of things like quitting and restarting Mail, bringing the various network interfaces back up and down, and other things to try to trick Mail into sending the queued messages but that has been haphazard at best. I can't help thinking that there is something obvious I am missing.
Thanks for any help!Highlight the message in the inbox, double-click on it, and click on the "send" icon
You may even consider BCCing yourself to see whether the message actually goes or not, and you just have an artifact copy stuck in your outbox that you could then just delete.
Otherwise, copy&paste the stuck message body into a new message, and delete the stuck one out of the outbox before attempting to send the new one -
SSRS Subscription LastStatus "Failure sending mail: Failure sending mail."
SSRS 2012, SQL 2012 SP2.
We have about 50 different daily subscriptions that go out. In the last month or so, probably over 30% of SSRS subscriptions are getting this error and no e-mail is sent. I have tested out the reports with the parameters and the reports run just
fine on demand for both the user and myself. I'll change the subscription forward for testing, and it will intermittently work or fail even when no traffic is hitting our database so I dont think it's a matter of performance.
I see nothing in the error logs, and I see nothing in the logtable 2, or 3 in ssrs as suggested by a few MSDB sites.
The only spot I can even see this error, is when viewing the subscription. I have done LOTS of searching, and most people get a helpful error after "Failure sending mail" where as I only get 'Failure sending mail: Failure sending mail"Hi,
Does your network is always available? Your scenario is so strange. Please check if you have missed something according to this article:
https://msdn.microsoft.com/en-us/library/ms159155.aspx. -
Issue with how Mail displays sender and recipient names in message list
Hi everyone!
I've been looking for a solution but had no luck so far.
Here's the issue:
In Mail, the sender email address or the recipient name would sometimes be displayed twice between chevrons.
For example, sometimes in my sent folder, in the "To" column, the recipient name is displayed twice like this <[email protected]> <[email protected]> whereas it used to be displayed once and without chevrons. This happened since i have reinstalled Snow Leopard (clean install).
Hope someone can help.
Thanks!Henry,
Please post this question on the weblogic.developer.interest.integration
newsgroup.
Regards,
Raj Alagumalai
Backline Workshop Support
"Henry Mugasha" <[email protected]> wrote in message
news:[email protected]..
Hi,
I am using a Task Control Factory to create Task Control Instances in aloop
and then
create tasks and assign them to a predefined group. I have an event choice
for two events
waiting for the onTaskCompleted and onTaskAborted event call backs.
I have two such operations (of task creation) in the same loop. For
simplicity I have used two separate task factory controls for each of the
tasks (because I even had worse problems using a single control factoryfor
both tasks in the same loop).
When I instantiate the process, through work list I am able to claim,start
and complete the first task. When I try the same procedure (claim, startand
complete) on the second task, the the event choice for the corresponding
task receives 2 event call backs. First it receives the onTaskCompleted as
expected, but then it also received another call back of the same typewhich
displays the error on the server log as:
<Sep 24, 2003 9:43:56 AM EDT> <Warning> <WLW> <000000> <on process
completion, 1 undelivered messages to
'sampleRequestTaskFactoryCtrl_onTaskCompleted'>
<Sep 24, 2003 9:43:56 AM EDT> <Warning> <WLW> <000000> <ejbLoad:
Conversation 1064411008439:null not found>
<Sep 24, 2003 9:43:56 AM EDT> <Warning> <WLW> <000000> <A message wasunable
to be delivered from a WLW Message Queue. Attempting to deliver the
onAsyncFailure event>
<Sep 24, 2003 9:43:56 AM EDT> <Warning> <WLW> <000000> <ejbLoad:
Conversation 1064411008439:null not found>
Does anybody know why two events are fired for the same work list action?
Thanks in advance.
Henry M -
Looking for .XSD for mail for sending the mail through mail adapter
Hi Experts,
I am looking for .XSD file for sending mail.I am using Mail adapter to send mail to report error occur on creating PO document in my scenario to a specified department's email id.I searched for many blogs but not get any .XSD file for email.Looking for a suugesstion.
Thanks
DeepakDo you have S -user name and password? If not then never mind, Copy the below XSD, I took it from the link which I gave to you.
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://sap.com/xi/XI/Mail/30"
xmlns:xi="http://sap.com/xi/XI/Mail/30"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Mail">
<xs:annotation>
<xs:documentation>Mail package for XI - Mail Adapter</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Subject" type="xs:string" minOccurs="0"/>
<xs:element name="From" type="xs:string" minOccurs="0"/>
<xs:element name="To" type="xs:string" minOccurs="0"/>
<xs:element name="Reply_To" type="xs:string" minOccurs="0"/>
<xs:element name="Content_Type" type="xs:string" minOccurs="0"/>
<xs:element name="Date" type="xs:dateTime" minOccurs="0"/>
<xs:element name="Message_ID" type="xs:string" minOccurs="0"/>
<xs:element name="X_Mailer" type="xs:string" minOccurs="0"/>
<xs:element name="Content" minOccurs="0">
<xs:annotation>
<xs:documentation>any type</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="encoding" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="MailReceipt">
<xs:annotation>
<xs:documentation>Mail Receipt for XI - Mail Adaper</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Server" type="xs:string"/>
<xs:element name="Format" type="xs:string"/>
<xs:element name="UseMailPackage" type="xs:boolean"/>
<xs:element name="Encoding" type="xs:string"/>
<xs:element name="Subject" type="xs:string" minOccurs="0"/>
<xs:element name="From" type="xs:dateTime" minOccurs="0"/>
<xs:element name="To" type="xs:string" minOccurs="0"/>
<xs:element name="Date" type="xs:dateTime" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema> -
Javax.mail.MessagingException: 451 Error while writing spool file??
Hi all friends,
Can any one plz tell me why Iam getting below error when Iam trying to send mail with attachment.Iam using Java Mail API.
javax.mail.MessagingException: 451 Error while writing spool file
Plz tell me what are the reasons behind it.
Regards
BikashThe problem here is that the SMTP server was unable to write its spool file.
The error is probably on the OS side of things and has nothing to do with email except that the lack of the system resource is causing email to fail.
Have the server admin take a look at his error log to find out why the the user that smtp is running as could not write the file. -
Sharepoint 2013 designer workflow mail not sending
Hi
I am doing sharepoint 2013 workflow for mail sending using designer.
I am sending mail when new item created in List.
Here status is completed, but mail not sending the following error comes
"The e-mail message cannot be sent. Make sure the e-mail has a valid recipient".
But i have valid email ID.
If i am sending mail through C# (Visual Webpart), mail sending properly.
Give me solution, Thanks in advanceCan you please check the below threads
http://social.technet.microsoft.com/Forums/sharepoint/en-US/3c76459c-01f5-4d75-be17-ee5b2ce1c1dd/sharepoint-designer-2013-workflow-not-sending-emails?forum=sharepointgeneral
http://social.technet.microsoft.com/Forums/sharepoint/en-US/caee58c6-3128-4241-92e2-62f1d0bff01f/sharepoint-workflow-not-sending-e-mail?forum=sharepointcustomizationlegacy
My Blog- http://www.sharepoint-journey.com|
If a post answers your question, please click Mark As Answeron that post andVote as Helpful -
Hi i had prepared a java program to send an attachment file it was compiled but when i interpret then it would show the error message as follows
PLEASE HELP ME
javax.mail.MessagingException: Unknown SMTP host: true;
nested exception is:
java.net.UnknownHostException: true
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1280)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:37
0)
at javax.mail.Service.connect(Service.java:275)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
at sendfile.postFile(sendfile.java:129)
at sendfile.main(sendfile.java:60)
Caused by: java.net.UnknownHostException: true
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
... 8 more
java.net.UnknownHostException: true
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:37
0)
at javax.mail.Service.connect(Service.java:275)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
at sendfile.postFile(sendfile.java:129)
at sendfile.main(sendfile.java:60)
aND MY SOURCE CODE IS
import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class SendingFile
static String SMTP_HOST_NAME = "smtp.gmail.com";
static String SMTP_AUTH_USER = "xxxx";
static String emailSubjectTxt = "From xxx S/W";
static String SMTP_AUTH_USER = "xxx";
static String SMTP_AUTH_PWD = "xxxxx";
static String emailFromAddress = "xxxx ";
static StringBuffer sb = new StringBuffer();
static String[] emailList = {"[email protected]", "[email protected]"};
static String filename = "user.htm";
public static void main(String args[]) throws Exception
SendingFile smtpMailSender = new SendingFile();
smtpMailSender.postMail( emailList, emailSubjectTxt, emailFromAddress, filename);
// create some properties and get the default Session
for(int i = 0; i<emailList.length; i++)
System.out.println("Sucessfully Sent mail to All Users"+emailList);
public void postMail( String recipients[ ], String message , String from, String filename) throws MessagingException
boolean debug = false;
Properties props = new Properties();
props.put("mail.smtp.host", SMTP_HOST_NAME);
props.put("mail.smtp.host", "true");
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getDefaultInstance(props, auth);
session.setDebug(debug);
// create a message
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
InternetAddress[] addressTo = new InternetAddress[recipients.length];
for (int i = 0; i < recipients.length; i++)
addressTo[i] = new InternetAddress(recipients[i]);
msg.setRecipients(Message.RecipientType.TO, addressTo);
// msg.setSubject(message);
// create and fill the first message part
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText(message);
// create the second message part
MimeBodyPart mbp2 = new MimeBodyPart();
// attach the file to the message
FileDataSource fds = new FileDataSource(filename);
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setFileName(fds.getName());
// create the Multipart and add its parts to it
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);
// add the Multipart to the message
msg.setContent(mp);
// set the Date: header
// msg.setSentDate(new Date());
// send the message
Transport.send(msg);
private class SMTPAuthenticator extends javax.mail.Authenticator
public PasswordAuthentication getPasswordAuthentication()
String username = SMTP_AUTH_USER;
String password = SMTP_AUTH_PWD;
return new PasswordAuthentication(username, password);
Message was edited by:
muthu2007
Message was edited by:
muthu2007props.put("mail.smtp.host", SMTP_HOST_NAME);
props.put("mail.smtp.host", "true");Remove the second line...
Christian -
Mail- wrong sender address stuck in outgoing que that will never be sent
I can't believe 'no one' has ever had this problem...
When I got my new iPod I was of course excited, and messed up my Mail account sender address setup. Of course, I tried sending a couple of test E-mails before I figured it out. I 'fixed' it, now it all works fine- EXCEPT the original test mails that were incorrect are stuck in an 'Outbox' I somehow cannot access. Every time I start Mail on the iTouch I have to go through the error message "Cannot send mail The sender address was invalid." I know what it is and want to delete the wrong sender address e-mails, but can't. There must be a way....I think I figured this out. First go deep into the outgoing mail server settings, click your primary server and be sure to enter you email user name and password again (same as what you but for incoming server). I also found that my desktop email program and the iPod Touch cannot be open at the same time (at least for me with Cox Communications), otherwise it detects two devices accessing at the same time and does not allow one to send or recieve. Hope this helps.
Maybe you are looking for
-
Application problems! Please help.
I have 1,496 songs, 11 Vids, 105 photos, 125 Applications. I can hold 29.1 GB and have 10.2 GBs left. my version is 4.3.3. I use two IDs to download Apps from. I have 30 Apps on one and 95 on the other. the 95 on this account, keep imediately returni
-
Need text and image in the message
Hi, I need to send an email with an image and text as part of the message, Ill do the following but it jsut takes the text and as an attachment, how can I include both content in the body of message?? BodyPart texto = new MimeBodyPart(); texto.setCon
-
Issue with Enqueue / Dequeue
We are working on a scenario where data is got into SAP through Web methods to create Sales orders. If we were to use Enqueue / Dequeue function while doing this would the web methods connection hold till the process is complete or would this time ou
-
How to install certificate in im client
i can't find the procedure for installing a certificate in the client - i did the server part: http://docs.sun.com/app/docs/doc/819-4412/6n6ikpsut?a=view but now i can't find how to do the client part - i'm just using the standard im client obtained
-
Get Grand total of the subtotals
Hi, I am devoloping a report which pulls the expense lines for each project.I am displaying the fte count at each line.As it'll be same for a particular project,all the lines for that particular project will show the same FTE count.I am grouping the