Kathleen_0422
Board Regular
- Joined
- May 5, 2011
- Messages
- 64
In ASP for website coding I can hardcode an email address "sent by" name using CDONTS. I do it all the time.
I am using Nate-O's code in Excel to send information via Lotus Notes. Is it possible to hard-code the sent from address in there?
ASP CODE:
Dim objNewMail, email, subject, msgbody
subject = "WLF Holiday Drive "
msgbody = vbNewLine
msgbody = msgbody & "********** FOR NOTIFICATION PURPOSES ONLY ***********************" & vbNewLine
msgbody = msgbody & "*******************************************************************" & vbNewLine & vbNewLine
msgbody = msgbody & "We have registered your donation of: " & vbNewLine & vbNewLine
Response.write vbNewLine & vbNewLine & vbNewLine
msgbody = msgbody & vbNewLine & vbNewLine & " Donations are needed by end of business on date goes here " & vbNewLine
msgbody = msgbody & " Please bring all donations to your nearest Board member:" & vbNewLine
email = request.form("emailAddress")
'response.write("E-Mail: " & email & "<BR>")
'response.write("Subject: " & subject & "<BR>")
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.Send "I_put_Email_Address_here.domain name here.com", email, subject, msgbody, 2
Here is the code from Nate-O which I would like to use if I can hardcode a sent by name.
Sub SendMail()
'Following code was pulled from mrexcel.com for sending emails
Dim Maildb As Object, MailDoc As Object, AttachMe As Object, AttachMe2 As Object, Session As Object
Dim UserName As String, MailDbName As String
Dim EmbedObj1 As Object
Dim EmbedObj2 As Object
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, _
(Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = Session.GetDataBase(vbNullString, MailDbName)
If Not Maildb.IsOpen Then Maildb.OpenMail
Set MailDoc = Maildb.CreateDocument
MailDoc.Form = "Memo"
MailDoc.sendto = arrRecips
MailDoc.CopyTo = arrRecipsCC
MailDoc.Subject = "Monthly Budget vs. Actual " & CostCenter 'Subject of e-mail
MailDoc.Body = CustomizeableMsg & vbNewLine & vbNewLine
Set AttachMe = MailDoc.CreateRichTextItem("Attachment")
Set EmbedObj1 = AttachMe.Embedobject(1454, vbNullString, _
"C:\Divisional Budget\" & ProcessPeriod & "\" & NameOfFile & ".xls", "Attachment 1 ") 'Attaches file to e-mail
MailDoc.SaveMessageOnSend = True
MailDoc.PostedDate = Now
I am using Nate-O's code in Excel to send information via Lotus Notes. Is it possible to hard-code the sent from address in there?
ASP CODE:
Dim objNewMail, email, subject, msgbody
subject = "WLF Holiday Drive "
msgbody = vbNewLine
msgbody = msgbody & "********** FOR NOTIFICATION PURPOSES ONLY ***********************" & vbNewLine
msgbody = msgbody & "*******************************************************************" & vbNewLine & vbNewLine
msgbody = msgbody & "We have registered your donation of: " & vbNewLine & vbNewLine
Response.write vbNewLine & vbNewLine & vbNewLine
msgbody = msgbody & vbNewLine & vbNewLine & " Donations are needed by end of business on date goes here " & vbNewLine
msgbody = msgbody & " Please bring all donations to your nearest Board member:" & vbNewLine
email = request.form("emailAddress")
'response.write("E-Mail: " & email & "<BR>")
'response.write("Subject: " & subject & "<BR>")
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.Send "I_put_Email_Address_here.domain name here.com", email, subject, msgbody, 2
Here is the code from Nate-O which I would like to use if I can hardcode a sent by name.
Sub SendMail()
'Following code was pulled from mrexcel.com for sending emails
Dim Maildb As Object, MailDoc As Object, AttachMe As Object, AttachMe2 As Object, Session As Object
Dim UserName As String, MailDbName As String
Dim EmbedObj1 As Object
Dim EmbedObj2 As Object
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, _
(Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = Session.GetDataBase(vbNullString, MailDbName)
If Not Maildb.IsOpen Then Maildb.OpenMail
Set MailDoc = Maildb.CreateDocument
MailDoc.Form = "Memo"
MailDoc.sendto = arrRecips
MailDoc.CopyTo = arrRecipsCC
MailDoc.Subject = "Monthly Budget vs. Actual " & CostCenter 'Subject of e-mail
MailDoc.Body = CustomizeableMsg & vbNewLine & vbNewLine
Set AttachMe = MailDoc.CreateRichTextItem("Attachment")
Set EmbedObj1 = AttachMe.Embedobject(1454, vbNullString, _
"C:\Divisional Budget\" & ProcessPeriod & "\" & NameOfFile & ".xls", "Attachment 1 ") 'Attaches file to e-mail
MailDoc.SaveMessageOnSend = True
MailDoc.PostedDate = Now