I am writing some code in VB6, that will fetch information from a form, and then build and HTML e-mail and send it off to a recipient. I can generate the e-mail with the HTML body no problem, but my images will not display in the e-mail. I get the message "The linked image cannot be displayed. The file may have been moved, renamed, or deleted. Verify that the link points to the correct file and location". I have verified that the file exists in the same folder as the application and my debug shows that it is pointing to the correct path, yet it will not show. This is the code i am using to link the images:
What am I doing wrong? as I cannot see it. Please help.Code:Private Sub SendEMail() Dim EMail As String Dim Subj As String Dim Msg As String Dim URL As String Dim Path As String Path = App.Path ' Get the email address EMail = EmailInput.Value ' Message subject Subj = "Weight Loss Challenge Starting " & CalInput.Text ' Compose the message Msg = "" Msg = Msg & "<html><body><div style=""text-align: left;""><span style=""font-family: Arial; font-size: 12pt;""><p>Dear " & NameInput.Value & ",<br /><br />" Msg = Msg & "Firstly let me say ""Thank you"" for you help, I really do appreciate it, secondly ""Well done"" for being at the Challenge. " Msg = Msg & "Good luck, not only for reaching your goals, but possibly the 1st prize. The 1st prize is yours this time.<br /><br />" Msg = Msg & "Please read and understand the first week's notes. As discussed, this week is just about protein. " Msg = Msg & "Meal plans etc. will be given to you next week. Please keep these results as we will be referring to them next week and " Msg = Msg & "you will be able to monitor your own progress over time.<br /><br />" Msg = Msg & "Remember I am only a telephone call away. Should you want to meet one-on-one, outside of the challenge, " Msg = Msg & "I have no problem with that at all.<br /><br />" Msg = Msg & "<b>Here is your wellness assessment:</b><br />" Msg = Msg & "Current weight: " & WeightInput.Value Msg = Msg & "kg. Ideal weight based on a BMI of 20-25: " & IdealWeightInput.Value & "kg<br />" Msg = Msg & "Height in meters: " & HeightInput.Value & " Age: " & AgeInput.Value & " Body Age: " & BodyAgeInput.Value & "<br />" Msg = Msg & "Body Fat %: " & BodyFatInput.Value & "% Ideal range: " & IdealBodyFatInput.Value & "<br />" Msg = Msg & "Your Body Mass Index (BMI): " & BMIInput.Value & "<br />" Msg = Msg & "Estimated Resting Metabolic Rate (RMR): " & RMRInput.Value & "<br />" Msg = Msg & "Daily Calorie intake: " & CalIntakeInput.Value & "Kcal<br />" Msg = Msg & "Daily Protein intake: " & ProtienIntakeInput.Value & "grams<br /><br />" Msg = Msg & "BMI Chart:" Msg = Msg & "</p><img src='" & Path & "\BMIChart.jpg' height=277 width=364>" Msg = Msg & "<p><br />Kind regards,<br /><br />" Msg = Msg & "Weight Loss Challenge Coach<br />" Msg = Msg & "</p><img src='" & Path & "\HL.jpg' height=100 width=350></span></body></html>" Mail.Send_Mail EMail, "", Subj, Msg, "", "", "" Me.MousePointer = vbDefault End Sub
Thanks in advance.