I am writing a web interface paging system. The main function of the system is to send SMS messages to cell phones and pagers, which I have accomplished this using email. However, when I send a message, the from address comes up as a string of 10 numbers. The actual from address is in the message.
Here's my code:
Dim mailMessage As New MailMessage()
Dim client As New SmtpClient(gateway)
mailMessage.From = New MailAddress(fromAddress)
mailMessage.Body = tbMessage.Text
mailMessage.To.Add(New MailAddress(toAddress))
client.Send(mailMessage)
The last email I sent to my phone turned up this:
From: 1410000033
Message:
FRM:email#provider.com
MSG:test
This is really annoying to anyone who gets paged because of all the random numbers in their message box instead of the actual address I sent the message from. This is also annoying because the from address uses a good bit of characters.
I have looked around and it looks to be a ATT gateway issue. The phone I've been testing this on is ATT. I do have a coworker with a Verizon phone and it appears to work fine.
Does anyone have any ideas on what I can do to correct this problem?
Related
My VB app can send an email to myself using the following code format:
Process.Start("mailto:test#myself.com&subject=somesubject&body=somebodytext")
This works well with email clients so far except Windows 10 Mail. For Mail the entire string is saved to the "To" line. What am I missing please?
"To" line: "test#myself.com?subject=somesubject&body=somebodytext"
Also, how best to test for Mail being the email client?
First, I know next to nothing about coding, but...
We have a vb file that we use so users can enter requests which in turn sends emails to various distribution lists. I did not create this file, it has been here long before I arrived.
It has worked fine until now and "nobody" made any changes.
The error we get is:
error BC30516: Overload resolution failed because no accessible 'New' accepts this number of arguments. msg = New System.Net.Mail.MailMessage("itrequest#bnhc.org")
The code goes like this:
' third Message
msg = New System.Net.Mail.MailMessage("itrequest#******.org")
msg.IsBodyHtml = True
subj = "New Hire Form Confirmation"
There are two other emails before this one, both coded the same way, just different destinations.
Any help is appreciated!
If this was working before then someone definitely modified it. You are creating an Instance MailMessage() without providing all of the parameters
msg = New System.Net.Mail.MailMessage("itrequest#******.org")
lists the sending email only however MailMessage requires a sending and receiving email
Dim msg = New System.Net.Mail.MailMessage("itrequest#******.org", "recipient#google.com")
replace recipient#google.com with your email recipient and you will no longer have this issue
I hope this helps
On a domino-built website I have a button that runs a lotusscript agent. Part of this agent sends emails out. Below is summary code/snippet to give you the idea of what I am doing
(only relevant lines of code):
dim sendtoString as string
dim sendtoArray as variant
sendtoString = "mailaddress1,mailaddress2" '<----- two email addresses in a string
sendtoArray = split(sendtoString,|,|)
maildoc.sendto = sendtoArray
maildoc.save(true,true) '<--- so I can look at it as a saved document
'maildoc.send(false) '<----- NOTE as of right now I am not sending, choosing to simply look at the saved version until I get this right
The strange thing is TWO documents are SAVED. I have not enabled the "send" line yet because I do not want multiple emails to be sent from the code, instead hoping the router will do this for me.
Maybe the send is going to work fine, and individuals will NOT receive multiple emails (if six email addresses are in the original string, I dont want six emails landing in each person's inbox).....and maybe I need to use the "SaveMessageOnSend" property instead.
Anyone have any insight on what is going on here?
Using LotusScript, you can generate and send email messages. When creating the email message, recipient email addresses must be assigned to the SendTo field. To send an email to a single recipient, simply set the object value to a valid email address. For example:
doc.SendTo = "someone#ibm.com"
However, when sending email to multiple recipients, you must create an array of values and append the values to the SendTo, CopyTo, or BlindCopyTo field(s). This can be achieved by building either a static or dynamic array of values.
For a full answer you can find on this blog: https://flylib.com/books/en/2.348.1/sending_email_to_multiple_recipients_using_lotusscript.html
I've got an emailing system in my application which I have used fine and have seen it working.
The customer has also managed to send emails using the program, however, once they've paid for the application, they're then selling it on to other customers.
They've just taken it in to test with the first customer and they're having troubles sending emails, so I investigated the error log and saw the following message:
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [BN6PR2201CA0027.namprd22.prod.outlook.com]
Now, after Googling this exact error message, the top result was this question, in which it's clear to see that the OP was trying to send a message from an email address that was hard-coded as "emailaddress". However, that isn't the case for me.
My code is as follows:
recipient = eMail
Smtp_Server.UseDefaultCredentials = False
Smtp_Server.Credentials = New Net.NetworkCredential(senderAdd, senderPass)
Smtp_Server.EnableSsl = False
Smtp_Server.Host = SMTPserver
AddHandler Smtp_Server.SendCompleted, AddressOf sendComplete
e_mail = New MailMessage()
e_mail.From = New MailAddress(senderAdd)
e_mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess
e_mail.To.Add(eMail)
e_mail.Subject = subj
e_mail.IsBodyHtml = False
e_mail.Body = bod
Smtp_Server.SendAsync(e_mail, userState)
Is there anything in here which would be causing this error? If so, what is it?
The variables are all set from a database table, and if there are any null values then the system will pop a message box to alert the user of this and then exit the subroutine and not send the email, so it's not an issue with null values - The only thing I can think of is that the credentials are wrong, but they've supposedly been verified by 3 different people as correct.
You might need to specify the domain. Use this constructor of the NetworkCredential class and pass in the domain.
Smtp_Server.Credentials = New Net.NetworkCredential(senderAdd, senderPass, "expectedDomainName")
Difficult to say for sure though because we can't reproduce this issue under your same conditions.
I want to send an e-mail without knowing SMTP.
I mean, i want my users to mail me through my soft, but the problem is that i don't know their #mail, then i don't know SMTP either.
I'm stuck here, thanks !
The easiest way may be to send an email through their own email client.
This code will open their default mail client and populate it with the specified adress subject and body:
Dim address As String = "reg#gmail.com"
Dim subject As String = "Help"
Dim body As String = "Please help me with this error"
Process.Start(String.Format("mailto:{0}?subject={1}&body={2}", address, subject, body))